fix: sync dateProvider from anvil stdout on every mined block#21829
Merged
PhilWindle merged 1 commit intomerge-train/spartanfrom Mar 20, 2026
Merged
fix: sync dateProvider from anvil stdout on every mined block#21829PhilWindle merged 1 commit intomerge-train/spartanfrom
PhilWindle merged 1 commit intomerge-train/spartanfrom
Conversation
spalladino
commented
Mar 20, 2026
Comment on lines
+426
to
+428
| if (!anvil) { | ||
| dateProvider.setTime((await ethCheatCodes.lastBlockTimestamp()) * 1000); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This meant that we were setting the wall time to what the time was when the last block was mined, which could have been seconds ago.
38e9d37 to
51bfa32
Compare
Anvil logs block timestamps to stdout on each mined block. Parse these and update the TestDateProvider so it stays in lockstep with the L1 chain, eliminating drift between wall clock and anvil chain time. Also rename cheatCodes.timestamp() to lastBlockTimestamp() to clarify it returns the latest block's discrete timestamp, not the current time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
51bfa32 to
562e53d
Compare
PhilWindle
approved these changes
Mar 20, 2026
Collaborator
|
❌ Failed to cherry-pick to |
spalladino
added a commit
that referenced
this pull request
Mar 20, 2026
Was needed due to clock drift between sequencer and anvil, but PR #21829 should now remove the need for that.
PhilWindle
added a commit
that referenced
this pull request
Mar 20, 2026
Was needed due to clock drift between sequencer and anvil, but PR #21829 should now remove the need for that.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 20, 2026
BEGIN_COMMIT_OVERRIDE feat(p2p): add tx validator for contract instance deployment addresses (#21771) fix: always deploy IRM for testnet (#21755) fix: avoid mutating caller's array via splice in snapshot sync (A-718) (#21759) chore: update network logs skill (#21785) feat(archiver): validate contract instance addresses before storing (#21787) fix: ensure no division by 0 (#21786) feat: support private fork releases via ci-release (#21778) fix: restrict scenario deployments to only nightly (#21798) fix(stdlib): zero-pad bufferFromFields when declared length exceeds payload (#21802) test(protocol-contracts): verify max-size bytecode fits in contract class log (#21818) fix: wire BOT_DA_GAS_LIMIT through helm/terraform for staging-public (#21809) fix: remove jest-mock-extended from worker processes + fix parallelize_strict silent failures (#21821) fix(archiver): throw on duplicate contract class or instance additions (#21799) chore: remove broadcasted function events (#21805) fix: sync dateProvider from anvil stdout on every mined block (#21829) fix(sequencer): use wall-clock time instead of L1 block timestamp for slot estimation (#21769) fix: use correct EthCheatCodes method name in epochs_missed_l1_slot test (#21848) feat(p2p): add tx validator for contract class id verification (#21788) feat: publisher funding (#21631) feat: batch chonk verifier TS integration (#21823) fix(sequencer): remove l1 block timestamp check (#21853) fix: use local IVC inputs for batch_verifier bench test (#21857) fix(p2p): centralize gossipsub penalization and fix inconsistencies (#21863) chore: publish GitHub releases to AztecProtocol/barretenberg (#21775) END_COMMIT_OVERRIDE
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.
Anvil logs block timestamps to stdout on each mined block. Parse these and update the TestDateProvider so it stays in lockstep with the L1 chain, eliminating drift between wall clock and anvil chain time.
Also rename cheatCodes.timestamp() to lastBlockTimestamp() to clarify it returns the latest block's discrete timestamp, not the current time.