-
Notifications
You must be signed in to change notification settings - Fork 807
Add fee.State to P-chain state #3248
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
Conversation
func getFeeState(db database.KeyValueReader) (fee.State, error) { | ||
feeStateBytes, err := db.Get(FeeStateKey) | ||
if err == database.ErrNotFound { | ||
return fee.State{}, nil |
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.
q: shouldn't the capacity be max here? I believe this case happens only before etna is activated. In such a casa shouldn't capacity be max instead of zero?
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.
The ACP doesn't specify this... I think that it makes more sense to have it be set to 0 so that the fork activation doesn't have a complexity spike (although I doubt this would really matter).
I'll make a PR to the ACP to clarify this.
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.
Added this to the spec: avalanche-foundation/ACPs#136. Feel free to comment on that PR if you think it should be a different value.
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.
I am not sure we init capacity in the right way when Etna is not activated yet.
Why this should be merged
Dynamic fees needs to track the capacity and excess usage of the chain for rate limiting and fee pricing.
How this works
Adds
GetFeeState
andSetFeeState
to thestate.Chain
interface.How this was tested