Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [#1869](https://github.com/crypto-org-chain/cronos/pull/1869) Add missing tx context during vm initialisation
* [#1872](https://github.com/crypto-org-chain/cronos/pull/1872) fix(evm): support 4byteTracer for tracer
* [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Add integration tests for preinstalls
* [#1882](https://github.com/crypto-org-chain/cronos/pull/1882) Add integration tests for eip2935

*Sep 4, 2025*

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ replace (
// release/v1.15
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd
// develop
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251002045626-63f3de0a10b2
github.com/evmos/ethermint => github.com/thomas-nguy/ethermint v0.4.2-0.20251003145706-7847a6e9c1aa
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,6 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251002045626-63f3de0a10b2 h1://0sA+PCGB9hyaX22kI7CaVcBJ+b4uV7rqo/BhTHi58=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251002045626-63f3de0a10b2/go.mod h1:CsJ9yDOjuoVWNOxSIiTJhiYziDyCx3pk2hlnj97eGJU=
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6 h1:6KPEi8dWkDSBddQb4NAvEXmNnTXymF3yVeTaT4Hz1iU=
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd h1:ebSnzvM9yKVGFjvoGly7LFQQCS2HuOWMCvQyByJ52Gs=
Expand Down Expand Up @@ -1717,6 +1715,8 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE=
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
github.com/thomas-nguy/ethermint v0.4.2-0.20251003145706-7847a6e9c1aa h1:eaJhKreQ81kuDNah9Sb+jIeHVbreIT6AZcoISQWz47s=
github.com/thomas-nguy/ethermint v0.4.2-0.20251003145706-7847a6e9c1aa/go.mod h1:CsJ9yDOjuoVWNOxSIiTJhiYziDyCx3pk2hlnj97eGJU=
github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
Expand Down
6 changes: 3 additions & 3 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ schema = 3
version = "v0.2.2"
hash = "sha256-0MLfSJKdeK3Z7tWAXTdzwB4091dmyxIX38S5SKH5QAw="
[mod."github.com/evmos/ethermint"]
version = "v0.22.1-0.20251002045626-63f3de0a10b2"
hash = "sha256-lpXYx7Q2NZnhmnT4Z9V7EMxovVZrV1cLjj5hLhtl5/w="
replaced = "github.com/crypto-org-chain/ethermint"
version = "v0.4.2-0.20251003145706-7847a6e9c1aa"
hash = "sha256-zxxGmCv6SkiELUOYHWJF571+nJ9pgLGXDSnRMHyu0DU="
replaced = "github.com/thomas-nguy/ethermint"
[mod."github.com/fatih/color"]
version = "v1.17.0"
hash = "sha256-QsKMy3MsvjbYNcA9jP8w6c3wpmWDZ0079bybAEzmXR0="
Expand Down
9 changes: 9 additions & 0 deletions integration_tests/contracts/contracts/TestEip2935.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;

contract TestEip2935 {
// helper that returns blockhash opcode result (to demonstrate opcode unchanged)
function blockhashOpcode(uint256 blk) public view returns (bytes32) {
return blockhash(blk);
}
}
60 changes: 60 additions & 0 deletions integration_tests/test_eip2935.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from hexbytes import HexBytes

from .cosmoscli import module_address
from .network import Cronos
from .utils import (
CONTRACTS,
deploy_contract,
submit_gov_proposal,
w3_wait_for_block,
)


def test_eip2935(cronos: Cronos):
"""
check eip2935
"""
w3 = cronos.w3
history_storage_address = "0x0000F90827F1C53a10cb7A02335B175320002935"
history_storage_code = w3.eth.get_code(history_storage_address)
assert history_storage_code == HexBytes("0x")

expected_history_storage_code = (
"0x3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f3560014303811160"
"4257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500"
)
history_storage_preinstall = {
"name": "HistoryStorage",
"address": history_storage_address,
"code": expected_history_storage_code,
}

msg = "/ethermint.evm.v1.MsgRegisterPreinstalls"
authority = module_address("gov")
submit_gov_proposal(
cronos,
msg,
messages=[
{
"@type": msg,
"authority": authority,
"preinstalls": [history_storage_preinstall],
}
],
)

history_storage_code = w3.eth.get_code(history_storage_address)
assert history_storage_code == HexBytes(expected_history_storage_code)

contract = deploy_contract(
w3,
CONTRACTS["TestEip2935"],
)

w3_wait_for_block(w3, w3.eth.block_number + 10, timeout=30)
start = w3.eth.block_number
w3_wait_for_block(w3, start + 10, timeout=30)
for i in range(0, 9):
block = w3.eth.get_block(start + 0)
stored = contract.caller.blockhashOpcode(start + 0)
assert stored == block.hash
1 change: 1 addition & 0 deletions integration_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"Simple7702Counter": "Simple7702Counter.sol",
"Utils": "Utils.sol",
"Counter": "Counter.sol",
"TestEip2935": "TestEip2935.sol",
}


Expand Down
2 changes: 2 additions & 0 deletions third_party/proto/ethermint/evm/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ message Params {
bool allow_unprotected_txs = 6;
// header_hash_num is the number of header hash to persist.
uint64 header_hash_num = 7;
// historyServeWindow for EIP 2935
uint64 history_serve_window = 8;
}
Loading