Skip to content

Remove EIP 2935#49

Merged
luiz-lvj merged 2 commits into
masterfrom
utils/remove-eip2935
May 22, 2026
Merged

Remove EIP 2935#49
luiz-lvj merged 2 commits into
masterfrom
utils/remove-eip2935

Conversation

@luiz-lvj

Copy link
Copy Markdown
Collaborator

Summary

Trim contracts/utils/Blockhash.sol down to the native BLOCKHASH opcode only. Drop the EIP-2935 history-storage code path: the canonical history-storage contract is not deployed on TRON today, so the staticcall to 0x0000F908...2935 always returns zero and the conditional branching is dead code.

Background

  • Native BLOCKHASH on TRON matches the EVM byte-for-byte — 256-block lookback, zero otherwise. Verified in java-tron's Program.java: the window check index < currentBlock && index >= max(256, currentBlock) - 256 is identical to Ethereum's semantics.
  • EIP-2935 history storage is not active on TRON. TIP-2935 is currently planned for the GreatVoyage v4.8.2 (Pyrrho) release (planning issue) and lives on develop in java-tron#6686, but no released java-tron version ships it and no proposal has activated it. The current tronbox/tre:dev image (and TRON mainnet) is v4.8.1, which does not include it.

If/when TIP-2935 ships and activates on TRON, the canonical address and bytecode are byte-for-byte identical to EIP-2935 (verified in HistoryBlockHashUtil.java), so the OZ library can be restored to its upstream form with no behavior change.

Changes

  • contracts/utils/Blockhash.sol — remove HISTORY_STORAGE_ADDRESS constant and _historyStorageCall private function; blockHash now delegates directly to the blockhash builtin. Doc comment updated to describe the native opcode-only behavior.
  • test/utils/Blockhash.test.js — drop the predeploy.eip2935 dependency and the supported/unsupported chain matrix; keep recent-block / old-block / future-block coverage.
  • test/utils/Blockhash.t.sol — deleted; the Foundry test exercised the EIP-2935 history-storage path we removed.

@luiz-lvj luiz-lvj requested a review from km631 May 21, 2026 16:30
@luiz-lvj luiz-lvj merged commit 72e4895 into master May 22, 2026
6 of 12 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.

2 participants