XDC Blockhash Store - #12370
Conversation
… deployment scenarios
|
Claude finished @batrr's task in 3m 19s —— View job Review: XDC Blockhash StoreReviewed correctness, edge cases, DI wiring, and hot-path performance. The lazy-deploy approach for the EIP-2935 history contract is sound and the test coverage of the store logic is good. However, there is one Critical DI wiring bug and a Medium hot-path concern. Inline comments posted on the relevant lines. 🔴 Critical1.
🟠 Medium2. LINQ + redundant full-bytecode compare every block —
🟡 Low
✅ Looks good
Verdict: Not mergeable as-is — the Critical DI registration must be fixed (and ideally the Medium hot-path compare) before merge.
|
…pendency injection and code consistency
|
@claude re review |
|
Claude finished @batrr's task in 1m 11s —— View job Re-review: XDC Blockhash StoreI re-checked the four files against my prior review. All previously flagged issues have been resolved. Previously-flagged issues — status
Verification notes
VerdictMergeable. The Critical DI bug and the Medium hot-path concern are both resolved; only optional cosmetic nits (#5 comment) remain. Already has a maintainer approval. |
|
|
||
| if (!hasCode) | ||
| { | ||
| worldState.CreateAccountIfNotExists(eip2935Account, 0); |
There was a problem hiding this comment.
you can also pass nonce in this call
| /// <summary> | ||
| /// The deployed bytecode of the EIP-2935 history-storage contract. | ||
| /// </summary> | ||
| public static readonly byte[] Code = Bytes.FromHexString("3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500"); |
There was a problem hiding this comment.
Should this be in chainspec?
Changes
XdcBlockhashStore(IBlockhashStorefor XDC) that deploys the EIP-2935 history contract on demand when it's missing, then records the parent block hash.Eip2935Constants.Code.BlockhashStore.ApplyBlockhashStateChangesvirtual so XDC can override it.XdcBlockhashStoreinXdcModule; add tests.Why
On Ethereum the EIP-2935 contract is deployed via a normal tx just before the fork, so the stock store assumes it already exists. XDC skips that step, so
XdcBlockhashStoredeploys it lazily (nonce=1) when the account has no code — reusing existing code if present, throwing on a code mismatch.Types of changes
Testing