Skip to content

docs(dev): Rex5 KeylessDeploy gas billing and SequencerRegistry note#53

Merged
Troublor merged 4 commits into
mainfrom
william/doc/rex5-dev-docs-update
Jun 11, 2026
Merged

docs(dev): Rex5 KeylessDeploy gas billing and SequencerRegistry note#53
Troublor merged 4 commits into
mainfrom
william/doc/rex5-dev-docs-update

Conversation

@Troublor

@Troublor Troublor commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses the remaining items from the doc-audit (the Rex4 → Rex5 staleness in overview.md was already fixed on main):

  • KeylessDeploy (Rex5 gas billing): documents that the outer transaction now pays dispatch overhead + sandbox gas used + signer materialization storage gas, with a billing table, sizing guidance for relayers, and a migration danger hint (10–100× relayer-side budget increase for storage-heavy deploys).
  • Documents related Rex5 KeylessDeploy behavior: trailing-bytes rejection, fee-free sandbox (signer needs no gas balance), GASPRICE == 0 inside the constructor, gasLimitOverride capped to the outer call's remaining gas, and sandbox resource usage counting toward the outer transaction's resource limits.
  • SequencerRegistry: adds a protocol-facing note under the system contract table with a link to the spec page.
  • Adds Rex5 to the spec-name terminology list in docs/AGENTS.md.

Verified against mega-evm origin/main: docs/spec/upgrades/rex5.md (§23 outer EVM gas debit), docs/spec/system-contracts/keyless-deploy.md, docs/spec/system-contracts/sequencer-registry.md, and crates/mega-evm/src/sandbox/execution.rs.

Test plan

  • Markdown-only change; verify rendering and links in the GitBook preview.
  • Cross-checked all stated gas values and behaviors against the Rex5 spec and implementation.

This PR was generated by an automated agent.

@Troublor Troublor added the agent label Jun 11, 2026
Comment thread docs/dev/execution/system-contracts.md Outdated
| --------------------- | ----------------------------------------------- | ---------------------------------------------------------------- |
| Dispatch overhead | 100,000 compute gas | Always — retained even if the deployment is rejected |
| Sandbox gas | Exact gas used by the re-executed deployment | On every completed deployment attempt, success or failure |
| Signer materialization | New-account storage gas for the inner signer | Only if the signer account does not exist yet (first attempt) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (first attempt) parenthetical is ambiguous — it could be read as "first of several retries" rather than "first time this signer address is ever materialized." Consider dropping it since the "does not exist yet" condition is already self-explanatory, or replace with a cleaner qualifier:

Suggested change
| Signer materialization | New-account storage gas for the inner signer | Only if the signer account does not exist yet (first attempt) |
| Signer materialization | New-account storage gas for the inner signer | Only if the signer account does not exist yet (one-time per signer address) |

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in cc415d9 — replaced "(first attempt)" with "(one-time per signer address)".

@github-actions

Copy link
Copy Markdown
Contributor

Review

Good PR — well-scoped Rex5 documentation update with accurate spec cross-references. Conventions are followed throughout.

Checklist

  • One sentence per line
  • GitBook hint blocks correctly opened/closed
  • Spec links use absolute https://docs.megaeth.com/spec/... URLs
  • Relative link resource-limits.md resolves correctly (file exists in same directory)
  • No new pages, so SUMMARY.md update not needed
  • Existing frontmatter on system-contracts.md intact

Notes

  • The danger hint ordering (Rex5 migration note before the sizing hint) is correct — developers need to know about the budget increase before they read the sizing guidance.
  • The "Dispatch overhead — retained even if the deployment is rejected" wording is clear in context: "rejected" refers to a failed sandbox deployment, not a reverted outer call.

One minor clarity suggestion left as an inline comment on the billing table.

@github-actions

Copy link
Copy Markdown
Contributor

Changes look correct and well-structured. One open inline thread remains unresolved — the (first attempt) parenthetical in the signer materialization row of the gas billing table. Address that before merging.

@github-actions

Copy link
Copy Markdown
Contributor

Review

LGTM with one minor note. The prior thread on signer materialization wording (PRRT_kwDOODfgX86Iq6Ns) was addressed — the current text uses the suggested (one-time per signer address) form — please resolve it manually.

What looks good:

  • Gas billing table is accurate and well-structured; the three-row breakdown (dispatch overhead / sandbox gas / signer materialization) maps cleanly to what the spec describes.
  • The sizing guidance paragraph and gasLimitOverride cap note are the right level of detail for a developer doc.
  • Migration danger hint is appropriately placed and the 10–100× range is a useful order-of-magnitude signal.
  • Precondition additions (trailing-bytes rejection, fee-free sandbox) are concise and correct.
  • One sentence per line throughout — formatting is consistent.

One nit:
In the new SequencerRegistry prose paragraph the contract name is styled as _SequencerRegistry_ (italic). Every other contract name in this file is either a link or plain text; a code span (`SequencerRegistry`) would be more consistent with how technical identifiers are rendered elsewhere, but this is a minor preference — not a blocker.

Comment thread docs/dev/execution/system-contracts.md Outdated
Comment on lines +16 to +19
MegaETH also runs protocol-facing system contracts that dapp code does not normally call.
The _SequencerRegistry_ (`0x6342000000000000000000000000000000000006`, introduced in Rex5) tracks the system address (Oracle and system-transaction authority) and the sequencer (mini-block signing key).
For the formal specification, see [SequencerRegistry (spec)](https://docs.megaeth.com/spec/system-contracts/sequencer-registry).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this new SequencerRegistry system contract not put in the table?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mega-putin why is this new SequencerRegistry system contract not put in the table?

@mega-putin

mega-putin Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Good catch.
I had called out SequencerRegistry in the intro prose because most dapp code does not interact with it directly, but I agree it should still be in the table since it is a canonical system contract with a fixed address that developers may need to reference.
I’ve added it to the table and kept a short section below for context.

@github-actions

Copy link
Copy Markdown
Contributor

Both prior thread issues are resolved: SequencerRegistry is in the table, and the "(one-time per signer address)" wording is in place.

The new content is clean:

  • Gas billing table is accurate and follows the summarize+link pattern from the dev-layer AGENTS.md.
  • Correct hint levels: danger for the Rex5 migration breaking change, warning for the existing gas sizing guidance.
  • One-sentence-per-line convention is maintained throughout.
  • Spec URLs use the correct absolute form (docs.megaeth.com/spec/ with the system-contracts/ prefix).
  • SequencerRegistry section is appropriately minimal given "most dapp code does not call it directly" — no interface needed.
  • Rex5 added to the spec-names terminology table in docs/AGENTS.md.

LGTM.

@mega-putin

mega-putin Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks — glad this looks good now.

@Troublor Troublor merged commit 4262a17 into main Jun 11, 2026
5 checks passed
@Troublor Troublor deleted the william/doc/rex5-dev-docs-update branch June 11, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants