Skip to content

docs: clarify block limit overfill behavior#18

Merged
Troublor merged 6 commits into
mainfrom
william/doc/clarify-block-limit-overfill
Mar 24, 2026
Merged

docs: clarify block limit overfill behavior#18
Troublor merged 6 commits into
mainfrom
william/doc/clarify-block-limit-overfill

Conversation

@Troublor

Copy link
Copy Markdown
Collaborator

Summary

  • Clarify in megaevm.md that per-block limits for post-execution resources (compute gas, data size, KV updates, state growth) allow the last transaction in a block to exceed the limit
  • Explain the 3-step enforcement: pre-execution check → execute → seal block
  • Add rationale: these limits can only be evaluated after execution, so the transaction is included rather than wasted

Test plan

  • Review rendered doc for clarity and accuracy
  • Cross-check against mega-evm block limiter implementation in limit.rs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 13, 2026

Copy link
Copy Markdown

Deploying megaeth-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: b77c408
Status: ✅  Deploy successful!
Preview URL: https://4f72bc26.megaeth-documentation.pages.dev
Branch Preview URL: https://william-doc-clarify-block-li.megaeth-documentation.pages.dev

View logs

Comment thread docs/megaevm.md Outdated
Comment on lines +146 to +148
The per-block limits for compute gas, data size, KV updates, and state growth
can only be fully evaluated after a transaction has been executed. When building
a block, these limits are enforced as follows:

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.

Factual error: the table above shows Compute Gas has no per-block limit (N/A). It should not be listed here.

Also, the introductory sentence wraps mid-sentence — per the style guide, each sentence should be on its own line.

Suggested change
The per-block limits for compute gas, data size, KV updates, and state growth
can only be fully evaluated after a transaction has been executed. When building
a block, these limits are enforced as follows:
The per-block limits for data size, KV updates, and state growth
can only be fully evaluated after a transaction has been executed.
When building a block, these limits are enforced as follows:

Comment thread docs/megaevm.md Outdated
Comment on lines +150 to +151
1. Before executing a transaction, the block builder checks whether _any previous transaction_ has already caused the block to exceed a per-block limit. If so, the new transaction is rejected _before_ execution and the block is sealed.
2. Otherwise, the transaction is executed. If its execution causes the block to exceed a per-block limit, the transaction is still included — it is not reverted or discarded. Per-transaction limits still apply.

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.

Multiple sentences per line, violating the "one sentence, one line" convention from CLAUDE.md.

Suggested change
1. Before executing a transaction, the block builder checks whether _any previous transaction_ has already caused the block to exceed a per-block limit. If so, the new transaction is rejected _before_ execution and the block is sealed.
2. Otherwise, the transaction is executed. If its execution causes the block to exceed a per-block limit, the transaction is still included — it is not reverted or discarded. Per-transaction limits still apply.
1. Before executing a transaction, the block builder checks whether _any previous transaction_ has already caused the block to exceed a per-block limit.
If so, the new transaction is rejected _before_ execution and the block is sealed.
2. Otherwise, the transaction is executed.
If its execution causes the block to exceed a per-block limit, the transaction is still included — it is not reverted or discarded.
Per-transaction limits still apply.

Comment thread docs/megaevm.md Outdated
Comment on lines +154 to +157
In other words, the last transaction in a block is allowed to push the block's
resource usage beyond the per-block limit. This maximizes block utilization by
avoiding the waste of a valid transaction whose resource consumption can only be
known after execution.

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.

Sentences wrap mid-line. Each sentence should be on its own line.

Suggested change
In other words, the last transaction in a block is allowed to push the block's
resource usage beyond the per-block limit. This maximizes block utilization by
avoiding the waste of a valid transaction whose resource consumption can only be
known after execution.
In other words, the last transaction in a block is allowed to push the block's resource usage beyond the per-block limit.
This maximizes block utilization by avoiding the waste of a valid transaction whose resource consumption can only be known after execution.

@claude

claude Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Two issues found:

Factual error (blocking): The introductory sentence lists "compute gas" as having a per-block limit, but the table above shows its per-block limit is N/A. It should only list data size, KV updates, and state growth.

Style (non-blocking): Several places have multiple sentences on a single line, violating the "one sentence, one line" convention from CLAUDE.md. Suggestions attached inline.

The content and 3-step enforcement model are clear and accurate (modulo the compute gas mistake) — this is a useful clarification.

@claude

claude Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

The previous inline comments have all been addressed in the latest commit — compute gas removed, one-sentence-per-line fixed throughout.

One process note: public/megaevm.html was committed manually, which CLAUDE.md says to avoid (CI rebuilds public/ automatically). It's harmless since CI will overwrite it, but worth avoiding in future PRs.

Content LGTM otherwise.

@Troublor Troublor merged commit 0927fe4 into main Mar 24, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant