Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: create UPGRADING guide #92

Merged
merged 14 commits into from
Jun 3, 2024
Merged

docs: create UPGRADING guide #92

merged 14 commits into from
Jun 3, 2024

Conversation

aljo242
Copy link
Collaborator

@aljo242 aljo242 commented Jun 3, 2024

No description provided.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
>
> The default parameters use the default Cosmos SDK bond denomination. The should be modified to your chain's fee denomination.

## Changes for End-Users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create a separate doc here for "How to Integrate x/feemarket as an end user" then just link it here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could leave the enumeration of the changes here, but you should move the next section to a new doc.

The new doc should just be "How to set fees for chains that use x/feemarket" -- just get right into it. Don't give historical context of how things are now different or how they used to be

>
> Fees are still paid using the `fees` [field](https://github.com/cosmos/cosmos-sdk/blob/d1aab15790570bff77aa0b8652288a276205efb0/proto/cosmos/tx/v1beta1/tx.proto#L214) of a Cosmos SDK Transaction as they were before.

### Querying Gas Price
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a clear "How to" guide for integrators with literally numbered steps:

  1. Query the base fee over grpc (or if there are other options) [mention the specific grpc query)
    -- Explain how to interpret this fee (Is it gas price? Is it gas amount? etc...)
  2. (Optional) Add a tip
  3. Multiply the base fee plus tip by the gas amount to get the total fee and set this in the transaction

Really hold their hand. Ideally, each of these would have a small go snippet, rather than 1 large go snippet

INTEGRATIONS.md Outdated
The deducted amount after a transaction will be:

```
deducted = tip + (gasConsumed * gasPrice)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using gasPrice to construct a transaction

There are two ways to construct a transaction with gasPrice:

  1. Provide the minimum fee: feeAmount = gasPrice * gasLimit (gasLimit gives the maximum amount of gas a transaction can consume. You can obtain appropriate gasLimit by simulating a transaction to see how much gas it consumes under normal conditions).
  2. Provide a "tip" in addition to the minimum fee: feeAmount=gasPrice * gasLimit + tip This will be paid to the block proposer and result in your transaction being placed ahead of others with lower tips (or being included in the block instead of others when the block is full)

Understanding Fee Deducted

The actual amount of fee deducted from the fee payer is based on gas consumed, not gasLimit.

The amount consumed is equal to the inferredTip + gasPrice * gasConsumed, where inferredTip = feeAmount - gasLimit * gasPrice (This may be different than the tip you specified when building the transaction because the gasPrice on chain may have changed since when you queried it.)

@aljo242 aljo242 merged commit 6eee90a into main Jun 3, 2024
8 checks passed
@aljo242 aljo242 deleted the docs/upgrading branch June 3, 2024 20:14
mergify bot pushed a commit that referenced this pull request Jun 3, 2024
* fix spec

* doc and sensible min values

* code

* information udpate

* linkto

* fix everythign

* fix everythign

* fix everythign

* fix

* annotate

* annotate

* suggestion

* lint

(cherry picked from commit 6eee90a)
aljo242 added a commit that referenced this pull request Jun 3, 2024
* fix spec

* doc and sensible min values

* code

* information udpate

* linkto

* fix everythign

* fix everythign

* fix everythign

* fix

* annotate

* annotate

* suggestion

* lint

(cherry picked from commit 6eee90a)

Co-authored-by: Alex Johnson <alex@skip.money>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants