fix(rex6): review-driven fixes + remaining hardening (follow-up to #348)#349
Closed
RealiCZ wants to merge 2 commits into
Closed
fix(rex6): review-driven fixes + remaining hardening (follow-up to #348)#349RealiCZ wants to merge 2 commits into
RealiCZ wants to merge 2 commits into
Conversation
Saturate the authority SALT-gas fold into initial_gas so a heavy-bucket authorization list is rejected as unaffordable instead of wrapping past the gas-limit checks; require the system caller alongside the promotion sentinel before granting the system-tx metering exemption (replay/t8n inputs can carry forged deposit fields); and read the deposit-caller materialization check through the non-hydrating balance/emptiness helper.
…tial_gas Extend the authority-fold hardening to its siblings: the callee/create new-account storage gas and the deposit-caller materialization gas are also SALT-priced and can saturate to u64::MAX, so fold them with saturating_add to keep an unaffordable transaction rejected instead of wrapping past the gas-limit check. Pinned by a CREATE saturation regression test.
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
Follow-up to #348 (the faithful REX6 migration). Collects the review-driven fixes and the remaining REX6 hardening so the migration PR itself stays a clean, byte-faithful merge. Base is the migration branch (
cz/feat/rex6-preview); retarget tomainonce #348 merges. All changes are REX6-only (unstable spec) or replay-safe hardening of frozen paths — no live-spec behavior changes.Fixes already applied (each pinned by a regression test)
initial_gas, so an intrinsically unaffordable transaction is rejected instead of wrapping past the gas-limit check.Remaining work (found in the pre-push adversarial sweep; not yet fixed)
is_system_originated's first branch grants the exemption oncaller == 0xffff…fffealone; a replay / t8n / directtransact_rawinput can set that caller without entering throughrun_system_call. Needs the exemption gated on the real system-call entry, not the caller address alone.validate()reads each authority account (and its code) beforepre_executionvalidates the caller's nonce / funds / code and the final Mega-gas bound; an otherwise-doomed type-4 tx still requests those accounts, which a minimal stateless witness cannot satisfy.