feat(sequencer)!: rework all fees#1647
Merged
ethanoroshiba merged 40 commits intomainfrom Oct 15, 2024
Merged
Conversation
joroshiba
reviewed
Oct 15, 2024
joroshiba
reviewed
Oct 15, 2024
Co-authored-by: Jordan Oroshiba <jordan@astria.org>
joroshiba
reviewed
Oct 15, 2024
Comment on lines
+31
to
+99
| let transfer_fees = app_state.fees().transfer; | ||
| state | ||
| .put_transfer_fees(transfer_fees) | ||
| .wrap_err("failed to store transfer fee components")?; | ||
|
|
||
| let sequence_fees = app_state.fees().sequence; | ||
| state | ||
| .put_sequence_fees(sequence_fees) | ||
| .wrap_err("failed to store sequence action fee components")?; | ||
|
|
||
| let ics20_withdrawal_fees = app_state.fees().ics20_withdrawal; | ||
| state | ||
| .put_ics20_withdrawal_fees(ics20_withdrawal_fees) | ||
| .wrap_err("failed to store ics20 withdrawal fee components")?; | ||
|
|
||
| let init_bridge_account_fees = app_state.fees().init_bridge_account; | ||
| state | ||
| .put_init_bridge_account_fees(init_bridge_account_fees) | ||
| .wrap_err("failed to store init bridge account fee components")?; | ||
|
|
||
| let bridge_lock_fees = app_state.fees().bridge_lock; | ||
| state | ||
| .put_bridge_lock_fees(bridge_lock_fees) | ||
| .wrap_err("failed to store bridge lock fee components")?; | ||
|
|
||
| let bridge_unlock_fees = app_state.fees().bridge_unlock; | ||
| state | ||
| .put_bridge_unlock_fees(bridge_unlock_fees) | ||
| .wrap_err("failed to store bridge unlock fee components")?; | ||
|
|
||
| let bridge_sudo_change_fees = app_state.fees().bridge_sudo_change; | ||
| state | ||
| .put_bridge_sudo_change_fees(bridge_sudo_change_fees) | ||
| .wrap_err("failed to store bridge sudo change fee components")?; | ||
|
|
||
| let ibc_relay_fees = app_state.fees().ibc_relay; | ||
| state | ||
| .put_ibc_relay_fees(ibc_relay_fees) | ||
| .wrap_err("failed to store ibc relay fee components")?; | ||
|
|
||
| let validator_update_fees = app_state.fees().validator_update; | ||
| state | ||
| .put_validator_update_fees(validator_update_fees) | ||
| .wrap_err("failed to store validator update fee components")?; | ||
|
|
||
| let fee_asset_change_fees = app_state.fees().fee_asset_change; | ||
| state | ||
| .put_fee_asset_change_fees(fee_asset_change_fees) | ||
| .wrap_err("failed to store fee asset change fee components")?; | ||
|
|
||
| let fee_change_fees = app_state.fees().fee_change; | ||
| state | ||
| .put_fee_change_fees(fee_change_fees) | ||
| .wrap_err("failed to store fee change fee components")?; | ||
|
|
||
| let ibc_relayer_change_fees = app_state.fees().ibc_relayer_change; | ||
| state | ||
| .put_ibc_relayer_change_fees(ibc_relayer_change_fees) | ||
| .wrap_err("failed to store ibc relayer change fee components")?; | ||
|
|
||
| let sudo_address_change_fees = app_state.fees().sudo_address_change; | ||
| state | ||
| .put_sudo_address_change_fees(sudo_address_change_fees) | ||
| .wrap_err("failed to store sudo address change fee components")?; | ||
|
|
||
| let ibc_sudo_change_fees = app_state.fees().ibc_sudo_change; | ||
| state | ||
| .put_ibc_sudo_change_fees(ibc_sudo_change_fees) | ||
| .wrap_err("failed to store ibc sudo change fee components")?; |
Member
There was a problem hiding this comment.
Should it fail if we have not set a single asset? It seems like the only action which needs to be required to be set in genesis (and thus enabled) is the FeeChange itself? If we can't set the fee then we can't do it for any other actions either?
joroshiba
reviewed
Oct 15, 2024
Comment on lines
+563
to
+576
| pub sequence: SequenceFeeComponents, | ||
| pub transfer: TransferFeeComponents, | ||
| pub ics20_withdrawal: Ics20WithdrawalFeeComponents, | ||
| pub init_bridge_account: InitBridgeAccountFeeComponents, | ||
| pub bridge_lock: BridgeLockFeeComponents, | ||
| pub bridge_unlock: BridgeUnlockFeeComponents, | ||
| pub bridge_sudo_change: BridgeSudoChangeFeeComponents, | ||
| pub ibc_relay: IbcRelayFeeComponents, | ||
| pub validator_update: ValidatorUpdateFeeComponents, | ||
| pub fee_asset_change: FeeAssetChangeFeeComponents, | ||
| pub fee_change: FeeChangeFeeComponents, | ||
| pub ibc_relayer_change: IbcRelayerChangeFeeComponents, | ||
| pub sudo_address_change: SudoAddressChangeFeeComponents, | ||
| pub ibc_sudo_change: IbcSudoChangeFeeComponents, |
Member
There was a problem hiding this comment.
Should most of these be Option? It seems the only which stricly must be set is fee_change?
joroshiba
approved these changes
Oct 15, 2024
Member
joroshiba
left a comment
There was a problem hiding this comment.
Approval for infra, couple notes on the genesis that I'm not blocking on.
steezeburger
added a commit
that referenced
this pull request
Oct 16, 2024
This was referenced Oct 16, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 21, 2024
## Summary Removes an unused variant of the internal storage implementation of sequencer asset component.t ## Background As part of #1647 fees were moved from the assets to the fees component. The present variant was overlooked. ## Changes - Remove a storage variant from the assets component. ## Testing Not applicable. Dead code. ## Breaking Changelist This is not a breaking change because a) the variant was never used (there was not even a theoretic way to write it after #1647) and b) no variants existed after the variant. If they had, this change would lead to a shift in the variants, causing breakage. --------- Co-authored-by: Fraser Hutchison <fraser@astria.org>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 23, 2024
## Summary Made all fees except for `FeeChange` action optional at genesis. ## Background Tracking PR for [this comment](#1647 (comment)). Allows for more flexibility at genesis. Post #1647, an action with no fees in the state is by default deactivated until it is explicitly given fees, even if they are 0. This is to allow for actions to be added in the future without breaking consensus, but also allows for more flexibility at genesis. Now, all actions can be disabled at genesis by making the fees optional, except for `FeeChange`, which is needed in order to activate actions by giving them fees. ## Changes - Made all fees in `GenesisFees` optional (except for fee_change). ## Testing Passing all tests. ## Related Issues closes #1662
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 24, 2024
## Summary Moves the initialization of allowed assets from the overall app to the fees component. ## Background #1647 moved fee asset state handling to the new `fees` component. It was overlooked that writing allowed fee assets should also happen in its init chain logic. ## Changes - Move initialization of app init state to the fees component. ## Testing Nothing has changed in terms of how the state is represented. Tests that rely on init chain still work. ## Breaking Changelist This is not a breaking change because the state after this change looks the same.
sgranfield4403-3
added a commit
to sgranfield4403-3/astria
that referenced
this pull request
Oct 2, 2025
## Summary Removes an unused variant of the internal storage implementation of sequencer asset component.t ## Background As part of astriaorg/astria#1647 fees were moved from the assets to the fees component. The present variant was overlooked. ## Changes - Remove a storage variant from the assets component. ## Testing Not applicable. Dead code. ## Breaking Changelist This is not a breaking change because a) the variant was never used (there was not even a theoretic way to write it after astriaorg/astria#1647) and b) no variants existed after the variant. If they had, this change would lead to a shift in the variants, causing breakage. --------- Co-authored-by: Fraser Hutchison <fraser@astria.org>
sgranfield4403-3
added a commit
to sgranfield4403-3/astria
that referenced
this pull request
Oct 2, 2025
## Summary Made all fees except for `FeeChange` action optional at genesis. ## Background Tracking PR for [this comment](astriaorg/astria#1647 (comment)). Allows for more flexibility at genesis. Post #1647, an action with no fees in the state is by default deactivated until it is explicitly given fees, even if they are 0. This is to allow for actions to be added in the future without breaking consensus, but also allows for more flexibility at genesis. Now, all actions can be disabled at genesis by making the fees optional, except for `FeeChange`, which is needed in order to activate actions by giving them fees. ## Changes - Made all fees in `GenesisFees` optional (except for fee_change). ## Testing Passing all tests. ## Related Issues closes #1662
sgranfield4403-3
added a commit
to sgranfield4403-3/astria
that referenced
this pull request
Oct 2, 2025
## Summary Moves the initialization of allowed assets from the overall app to the fees component. ## Background astriaorg/astria#1647 moved fee asset state handling to the new `fees` component. It was overlooked that writing allowed fee assets should also happen in its init chain logic. ## Changes - Move initialization of app init state to the fees component. ## Testing Nothing has changed in terms of how the state is represented. Tests that rely on init chain still work. ## Breaking Changelist This is not a breaking change because the state after this change looks the same.
AngieD101
added a commit
to AngieD101/astria
that referenced
this pull request
Oct 10, 2025
## Summary Removes an unused variant of the internal storage implementation of sequencer asset component.t ## Background As part of astriaorg/astria#1647 fees were moved from the assets to the fees component. The present variant was overlooked. ## Changes - Remove a storage variant from the assets component. ## Testing Not applicable. Dead code. ## Breaking Changelist This is not a breaking change because a) the variant was never used (there was not even a theoretic way to write it after astriaorg/astria#1647) and b) no variants existed after the variant. If they had, this change would lead to a shift in the variants, causing breakage. --------- Co-authored-by: Fraser Hutchison <fraser@astria.org>
AngieD101
added a commit
to AngieD101/astria
that referenced
this pull request
Oct 10, 2025
## Summary Made all fees except for `FeeChange` action optional at genesis. ## Background Tracking PR for [this comment](astriaorg/astria#1647 (comment)). Allows for more flexibility at genesis. Post #1647, an action with no fees in the state is by default deactivated until it is explicitly given fees, even if they are 0. This is to allow for actions to be added in the future without breaking consensus, but also allows for more flexibility at genesis. Now, all actions can be disabled at genesis by making the fees optional, except for `FeeChange`, which is needed in order to activate actions by giving them fees. ## Changes - Made all fees in `GenesisFees` optional (except for fee_change). ## Testing Passing all tests. ## Related Issues closes #1662
AngieD101
added a commit
to AngieD101/astria
that referenced
this pull request
Oct 10, 2025
## Summary Moves the initialization of allowed assets from the overall app to the fees component. ## Background astriaorg/astria#1647 moved fee asset state handling to the new `fees` component. It was overlooked that writing allowed fee assets should also happen in its init chain logic. ## Changes - Move initialization of app init state to the fees component. ## Testing Nothing has changed in terms of how the state is represented. Tests that rely on init chain still work. ## Breaking Changelist This is not a breaking change because the state after this change looks the same.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gutted all current fee handling and replaced all with single fee calculation method in new trait.
Background
This implementation will simplify not only our fee calculation, but the process for adding new actions in the future.
Changes
FeeComponentstypes for all fee-bearing transactions which all have a base fee component and a computed cost multiplier component.base_fee + computed_cost_base * computed_cost_multiplierinit_chain().FeeChangeto be an enum which takes any fee-bearing action's fee components.FeeChangeandFeeAssetChange'sActionHandlerimpls to the fees component.Testing
All previous tests passing, added new tests for all state fee reads/writes.
Breaking Changelist
FeeChangeaction.Related Issues
closes #1369
closes #1145