fix(anvil): parse Tempo expiring nonce fields from hex strings#14259
Merged
zerosnacks merged 2 commits intofoundry-rs:masterfrom Apr 13, 2026
Merged
fix(anvil): parse Tempo expiring nonce fields from hex strings#14259zerosnacks merged 2 commits intofoundry-rs:masterfrom
zerosnacks merged 2 commits intofoundry-rs:masterfrom
Conversation
validBefore arrives as a hex string in the RPC other fields. Deserializing as u64 silently failed, causing tempo_tx_env to never be set. Parse as U256 (which handles hex) then convert to u64. Also set tempo_tx_env when valid_before is present, even if nonce_key is zero.
figtracer
commented
Apr 10, 2026
| // unique hash for expiring-nonce replay protection. The nonce | ||
| // manager needs a non-zero hash; the actual value doesn't matter | ||
| // because the state is discarded after estimation. | ||
| let estimation_hash = keccak256(base.data.as_ref()); |
Collaborator
Author
There was a problem hiding this comment.
this is prob too heavy for the use-case, something to think abt
The custom parse_hex helper only handled string values, breaking gas estimation when validBefore was passed as a JSON number. U256's Deserialize impl already handles both hex strings and plain numbers, so use get_deserialized<U256> consistently and convert to u64 with saturating_to. Co-authored-by: Amp <amp@ampcode.com>
mablr
reviewed
Apr 10, 2026
Collaborator
mablr
left a comment
There was a problem hiding this comment.
Fixed regression due to wrong deserialization 🫡
zerosnacks
approved these changes
Apr 13, 2026
mablr
approved these changes
Apr 13, 2026
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
Fixes
cast send --tempo.expiring-nonceagainst local anvil which previously failed withexpiring nonce transaction requires tempo_tx_env.