-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add unrecorded blocks abstraction to gas price algo #2468
Merged
Merged
Changes from 55 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
448d8c2
Remove height parameter, change tests
MitchTurner c5866a3
Modify to take vec instead of range
MitchTurner c54f098
Add tests to make sure it is sane
MitchTurner fcf4477
Rename variable
MitchTurner 159d5b4
Fix analyzer
MitchTurner ba080ff
Rename some params
MitchTurner d2b3c28
Use slice instead of vec
MitchTurner 128a9ba
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 5f19932
Cleanup code a bit
MitchTurner 922f3e0
Update crates/fuel-gas-price-algorithm/src/v1/tests/update_da_record_…
MitchTurner d7e9bdd
Pick nit
MitchTurner 12c517e
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner f8dca06
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 2bb86fe
Optimize projected calc by caching running total
MitchTurner 60771e9
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 03da963
Fix analyzer
MitchTurner ea14e6f
Simplify metadata
MitchTurner b615b33
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner cfd1a71
Merge remote-tracking branch 'origin' into feature/allow-DA-blocks-to…
MitchTurner d983891
Resolve logical conflicts from merge
MitchTurner 4c2b844
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 1836656
WIP
MitchTurner 48fe978
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 18fefb7
Merge branch 'feature/allow-DA-blocks-to-be-received-out-of-order' in…
MitchTurner b15a93f
Get compiling
MitchTurner 279191c
Start adding tests
MitchTurner 63b0266
Get existing tests passing
MitchTurner 477c731
WIP
MitchTurner b578a8e
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 7ca55c7
Ignore entire batches with blocks not in the unrecorded_blocks
MitchTurner 6ac41de
Add comments to explain unexpected behavior
MitchTurner f2af4aa
Merge branch 'master' into feature/allow-DA-blocks-to-be-received-out…
MitchTurner 4e07415
Merge branch 'feature/allow-DA-blocks-to-be-received-out-of-order' in…
MitchTurner cc90cbd
Fix tracing messages to be emitted at the right time
MitchTurner 11df7ae
Merge branch 'feature/allow-DA-blocks-to-be-received-out-of-order' in…
MitchTurner 7ac01aa
Fix logic to always remove recorded blocks, use predicted cost as bes…
MitchTurner ca6e1e5
Merge branch 'feature/allow-DA-blocks-to-be-received-out-of-order' in…
MitchTurner 2592ad0
Update CHANGELOG
MitchTurner eb233ab
Remove some TODOs
MitchTurner d32b347
Remove other todo
MitchTurner 9f78fa6
Add tests, fix bad bug
MitchTurner 6b9969c
Merge branch 'feature/allow-DA-blocks-to-be-received-out-of-order' in…
MitchTurner fc8c427
Fix copy-paste errors
MitchTurner 87dc547
Fix broken tests
MitchTurner 008f5fb
Correct test, use trace instead of debug
MitchTurner a409e6e
Merge remote-tracking branch 'origin' into feature/init-task-for-v1-g…
MitchTurner 24d4a5d
Introduce unrecorded blocks abstraction without implementation
MitchTurner 9f6a649
Use fuel storage in impl
MitchTurner 1261c4d
Implement adapter
MitchTurner 58f749b
Add simple tests
MitchTurner f969e88
Fix test, update CHANGELOG
MitchTurner b2051ce
update comment
MitchTurner 68a21de
Make generic arg consistent
MitchTurner 9276cc9
Appease Clippy-sama
MitchTurner 3679422
Remove estra import
MitchTurner 2a06ec0
Merge branch 'master' into feature/init-task-for-v1-gas-price-service
MitchTurner 6af9589
Restructure the algo methods to accomodate storage txs
MitchTurner b9d6571
Update crates/services/gas_price_service/src/v0/service.rs
MitchTurner 770998e
WIP
MitchTurner 0c4640e
Simplify generic constraints
MitchTurner 309d2cb
Merge branch 'feature/init-task-for-v1-gas-price-service', remote-tra…
MitchTurner 5d5d48b
WIP adding transactionable storage
MitchTurner 3c0a0ff
WIP fixing lifetime issues
MitchTurner 36bbb4d
Incremental improvements to compiler errors
MitchTurner 1447d90
Fix compilation errors with lifetimes
MitchTurner 755f7b0
Add passing test
MitchTurner 05ddee6
Fix another test
MitchTurner d9bbe36
Fix another test
MitchTurner b70b2eb
Fix remaining test
MitchTurner f443289
Merge branch 'master' into feature/init-task-for-v1-gas-price-service
MitchTurner 921b6e2
Merge branch 'feature/init-task-for-v1-gas-price-service' into chore/…
MitchTurner 8009b07
Remove commented code
MitchTurner 0bb7e7a
More cleanup
MitchTurner ed9dab4
Remove unused dep
MitchTurner 6c5df4c
Update CHANGELOG
MitchTurner a6caf6c
Add test for updating sequence number
MitchTurner 5dcfcb7
Add test for reading sequence number
MitchTurner a587b8a
Separate traits out into get and set traits
MitchTurner 37235ae
Fix broken test
MitchTurner 96f6b9d
Cleanup extra code, remove unused imports, hide imlementations.
MitchTurner f43f00d
Merge branch 'master' into feature/init-task-for-v1-gas-price-service
MitchTurner e80edd5
Merge branch 'feature/init-task-for-v1-gas-price-service' into chore/…
MitchTurner 51d41c7
Correct typo
MitchTurner 17a56d3
Merge branch 'feature/init-task-for-v1-gas-price-service' into chore/…
MitchTurner a642cb7
Use relevant config for v1 constructor
MitchTurner 8b027b9
Merge branch 'feature/init-task-for-v1-gas-price-service' into chore/…
MitchTurner abf0cca
Add todo
MitchTurner 2469bf8
Merge remote-tracking branch 'origin' into chore/add-unrecorded-block…
MitchTurner 288f51f
Add missed things
MitchTurner 00daced
Merge branch 'master' into chore/add-unrecorded-blocks-trait
MitchTurner 9fe913c
Remove extra code from merge
MitchTurner 009a847
Merge branch 'master' into chore/add-unrecorded-blocks-trait
MitchTurner 2eba245
Suggestions to simplify the V1 storage requirements and initializatio…
xgreenx 1b74ff5
Small simplificaitons
xgreenx 986c6c6
Fix the setting of the sequence number
MitchTurner ffce782
Format
MitchTurner 4fc7184
Remove comment, move mutation, rename field
MitchTurner ee1c886
Fix compilation
MitchTurner 43e19f2
Appease Clippy-sama
MitchTurner 93876fa
Rename sequence number to bundle id
MitchTurner 398ecec
Merge branch 'master' into chore/add-unrecorded-blocks-trait
MitchTurner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
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.
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.
nit: I usually try do advocate for the
Newtype
pattern (see https://www.lurklurk.org/effective-rust/newtype.html).In this case I think that we have this type defined somewhere else already
fuel-core/crates/types/src/blockchain/primitives.rs
Line 111 in 773226c
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.
Yeah. I don't want to use foreign types here. I want to keep the domain independent.
I'm not completely sold on using newtypes for situations like this. I mostly just added this for readability on the
BTreeMap
generics, otherwise people would just be guessing what theu32
andu64
represent. But the newtype would add an additional construct orFrom
conversion for the caller, an that's noisy IMO.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 also agree newtype is overkill here, but this particular issue can be solved by taking
impl Into<Height>
as arguments instead of specifying the type in the function signature.