-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sequencer)!: transaction categories on UnsignedTransaction (#1512)
## Note for Reviewers Most of the logic changes are in the files `crates/astria-core/src/protocol/transaction/v1alpha1/action_group.rs` and `crates/astria-core/src/protocol/transaction/v1alpha1/mod.rs`. The rest of the changes are updating the construction of `UnsignedTransactions` and/or changing the access to the inner fields. ## Summary Adds restrictions on what type of `Actions` can be included in the same `UnsignedTransaction`. Implements the categories as described in #1412 but with slightly different names: - General: - TransferAction - SequenceAction - BridgeLockAction - BridgeUnlockAction - IbcRelay - Ics20Withdrawal - ValidatorUpdate - UnbundeableGeneral (Instead of Bridge Control): - InitBridgeAccountAction - BridgeSudoChangeAction - Sudo: - FeeAssetChangeAction - FeeChangeAction - IbcRelayerChangeAction - UnbundleableSudo (Instead of Sudo Control): - SudoAddressChangeAction - IbcSudoChangeAction The check is applied at the time of constructing the `UnsignedTransaction`. The `UnsignedTransaction` additionally had its struct fields changed to private and now uses a new constructor to prevent the contained actions from being modified. ## Background We want transactions that can affect the validity of other transactions to be ordered last in blocks to reduce the amount of failed transactions we process. These logic changes are the first code changes being made to realize this goal. ## Changes - Introduced the `Actions` struct to hold valid groupings of `Actions`. - Introduced `ActionGroup` enum to represent which `Actions` can be included together in a transaction and if more than one action can be included in a transaction. - Changed the `UnsignedTransaction` struct to have private fields and to use a new constructor. - Changed the `UnsignedTransaction`'s `action` to be a `Actions` type instead of just a vector of `Actions`. ## Testing Unit testing and ran locally. ## Breaking Changelist Transactions that contain invalid `ActionGroup` combos (due to mixed groups or multiple actions in non-bundleable group types) are now 'invalid' transactions. I had to update one of the snapshot tests due to having to unbundle some of the transactions, creating a new state. ## Related Issues Initial steps for #1412 closes #1414, #1416
- Loading branch information
Showing
25 changed files
with
1,148 additions
and
709 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.