-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
> | ||
> The default parameters use the default Cosmos SDK bond denomination. The should be modified to your chain's fee denomination. | ||
|
||
## Changes for End-Users |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
- 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...) - (Optional) Add a tip
- 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) |
There was a problem hiding this comment.
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
:
- Provide the minimum fee:
feeAmount = gasPrice * gasLimit
(gasLimit
gives the maximum amount of gas a transaction can consume. You can obtain appropriategasLimit
by simulating a transaction to see how much gas it consumes under normal conditions). - 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.)
* 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 <[email protected]>
No description provided.