Impl transaction-payment GenesisConfig with NextFeeMultplier support#12177
Conversation
|
Looks good to me, but I'll let more experienced colleagues to check (assigned). Could you run |
|
/cmd queue -c fmt $ 1 |
|
"$PIPELINE_SCRIPTS_DIR/fmt.sh" 1 was queued. Comment |
|
@ggwpez Command |
|
bot merge |
|
Waiting for commit status. |
|
Merge cancelled due to error. Error: Statuses failed for 5ed0add |
|
I'll be happy to add a test, and I'd also like to create and document a const for the value 1. Also, what's this |
No idea, probably intermittent, and you can ignore |
|
|
||
| /// Default value for NextFeeMultiplier. This is used in genesis and is also used in | ||
| /// NextFeeMultiplierOnEmpty() to provide a value when none exists in storage. | ||
| const MULTIPLIER_DEFAULT_VALUE: Multiplier = Multiplier::from_u32(1); |
There was a problem hiding this comment.
Please review, esp. that from_u32(1) is equivalent to saturating_from_integer(1). The latter wasn't const and couldn't be used here.
My tests should verify this, but I'd appreciate another look at it.
I added a couple very basic tests. If there's something else you'd like to see tested, let me know. |
kianenigma
left a comment
There was a problem hiding this comment.
@dmitry-markin don't see why this needs an audit?
@kianenigma guess I missed the part of the label description stating that external audit is required. |
|
bot merge |
…aritytech#12177) * Impl GenesisConfig with NextFeeMultplier support * Update lib.rs * Use documented const * Unit test multiplier genesis * fmt Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This allows an initial value for
NextFeeMultiplierto be provided at genesis.The current implementation hard-codes the initial value to
FixedU128::saturating_from_integer(1)when it is absent. While this can be adjusted arbitrarily withFeeMultiplierUpdate, this doesn't kick in until the end of block 1.This means that block 1 fees are impractical on any runtime for which 1 is not a sane value. This is particularly problematic for testing.
An alternative approach would be to add an initial value to the runtime config, but this didn't seem worth the extra bloat to me.