feat(sequencer): have app recost transactions on fee or asset change#1411
Merged
lobstergrindset merged 7 commits intolilyjjo/mempool_balance_awarefrom Sep 9, 2024
Merged
Conversation
fd00012 to
cf83c96
Compare
Fraser999
approved these changes
Sep 6, 2024
| } | ||
|
|
||
| pub(crate) async fn mock_state_getter() -> StateDelta<Snapshot> { | ||
| let storage = cnidarium::TempStorage::new().await.unwrap(); |
Contributor
There was a problem hiding this comment.
In the future we might need to return the storage instance too so it can be kept alive. Just now our tests must not be actually committing anything to the DB (since it's dropped at the end of this function). For now though, I think this is fine.
e5a1276 to
4014969
Compare
4014969 to
a0d157c
Compare
bd4d910 to
928b3cd
Compare
751c709 to
588ee6b
Compare
68b1b07 to
928b3cd
Compare
Regular 2 week release cuts, includes breaking changes to sequencer, bridge-withdrawer, patch updates for composer, conductor and cli.
lobstergrindset
added a commit
that referenced
this pull request
Sep 11, 2024
…1411) This PR builds on top of the mempool balance aware logic to recost the mempool when a `FeeAssetChange` or `FeeChange` action are seen in a finalized block. There needs to be a follow up PR to ensure that the `FeeChange` and `FeeAssetChange` actions are only ran at the end of the block to ensure that transactions are invalidated mid-block due to fee changes. The mempool needs to recost transactions if the fees are changed, as the original placement of the transaction in the `parked` or `pending` structure may be out of date. - Added logic to flag when `FeeAssetChange` or `FeeChange` actions are included in a block. - The mempool will now re-cost transactions when this happens. - Changed the mempool to use the app's state directly instead of using getters Unit tests for the mempool and the app logic. This doesn't have breaking changes, but the snapshot files were re-generated because I changed the public addresses for `CAROL_ADDRESS`, `BOB_ADDRESS`, and `JUDY_ADDRESS` in the `test_utils.rs` file. I needed access to their private keys to sign transactions for testing promotion flows on the app level. Added `MEMPOOL_RECOSTED` counter to provide metrics on how often fees are being changed. --------- Co-authored-by: Jordan Oroshiba <jordan@astria.org>
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
This PR builds on top of the mempool balance aware logic to recost the mempool when a
FeeAssetChangeorFeeChangeaction are seen in a finalized block.There needs to be a follow up PR to ensure that the
FeeChangeandFeeAssetChangeactions are only ran at the end of the block to ensure that transactions are invalidated mid-block due to fee changes.Background
The mempool needs to recost transactions if the fees are changed, as the original placement of the transaction in the
parkedorpendingstructure may be out of date.Changes
FeeAssetChangeorFeeChangeactions are included in a block.Testing
Unit tests for the mempool and the app logic.
Breaking changes
This doesn't have breaking changes, but the snapshot files were re-generated because I changed the public addresses for
CAROL_ADDRESS,BOB_ADDRESS, andJUDY_ADDRESSin thetest_utils.rsfile. I needed access to their private keys to sign transactions for testing promotion flows on the app level.Metrics
Added
MEMPOOL_RECOSTEDcounter to provide metrics on how often fees are being changed.