-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unrecorded blocks abstraction to gas price algo (#2468)
## Linked Issues/PRs Closes #2454 ## Description This PR: - Adds a trait to the V1 algorithm for storing unrecorded blocks - Adds `TransactionableStorage` trait to gas price service to allow abstraction for atomic commits to storage (once per L2 block - Separates `Get` and `Set` traits for service to specify which need a transaction to execute - Add a `GetSequenceNumber` and `SetSequence` number concept for tracking the DA sequence number the DA service should start on at startup (I can't remember why this got included in this PR, but it felt logical at the time...) We only need a key-value lookup for the unrecorded blocks. Instead of storing all the data in the metadata, we just moved it to its own abstraction that can be accessed directly from the algorithm. This will also help with historical view, since historical view doesn't have a way to iterate over all values for that height, just do KV lookups. We were iterating before this change. Also added the `unrecorded_block_bytes` field to metadata so we can still track that in the case of historical view. This exposed a problem with the design, which is that we need changes to the algorithm to be atomic per l2 block, which is how our Fuel Storage is designed. This led us to introducing a `TransactionableStorage` trait for the service, which can be handed to the algorithm updater before being "commit"ed. The same applies to the `MetadataStorage`, so the service was redesigned slightly to accomodate this change. ## Checklist - [x] New behavior is reflected in tests ### Before requesting review - [ ] I have reviewed the code myself --------- Co-authored-by: Rafał Chabowski <[email protected]> Co-authored-by: Green Baneling <[email protected]>
- Loading branch information
1 parent
856d5da
commit 2ea9cd4
Showing
22 changed files
with
1,404 additions
and
626 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
Oops, something went wrong.