diff --git a/CHANGELOG.md b/CHANGELOG.md index 161bf512bf..684eeaf7f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## UNRELEASED + +### Improvements + * [#1895](https://github.com/crypto-org-chain/cronos/pull/1895) feat: use cronos store. * [#1908](https://github.com/crypto-org-chain/cronos/pull/1908) Add db migration/patch CLI tool * [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Support for preinstalls @@ -8,6 +11,7 @@ * [#1880](https://github.com/crypto-org-chain/cronos/pull/1880) Move module from v2 to v1 to follow semver convention * [#1933](https://github.com/crypto-org-chain/cronos/pull/1933) Chore: add validation for HeaderHashNum and HistoryServeWindow in evm params * [#1941](https://github.com/crypto-org-chain/cronos/pull/1941) fix: return calculated gas instead of panic for RelayerContract, add guards for ica precompile and ibc getSourceChannelId +* [#1932](https://github.com/crypto-org-chain/cronos/pull/1932) Support create_access_list *Dec 4, 2025* diff --git a/go.mod b/go.mod index f37170b4d8..a292d9efce 100644 --- a/go.mod +++ b/go.mod @@ -303,7 +303,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.20251210080935-9a1a449c16db + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251212021209-7da2d575eebe // 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 diff --git a/go.sum b/go.sum index 1aacc92b36..ef0d572b95 100644 --- a/go.sum +++ b/go.sum @@ -917,8 +917,8 @@ github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f0 github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f07/go.mod h1:QtmMmgHYQqioX/U2OfucmqDgXMmrL3N8/QXom4UWeKg= github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07 h1:eMuGwzyL4ond46wHHIybHT9fBoFxfWzkeX87IannqG4= github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07/go.mod h1:6sg+tT7xMKDS8HL9Rxq1QsLJHApMuh+vnr2HVl3utl0= -github.com/crypto-org-chain/ethermint v0.22.1-0.20251210080935-9a1a449c16db h1:2L2dp9JExInGc5OK+WEujqf1sSk2pnBKtZ09XDR/Bgs= -github.com/crypto-org-chain/ethermint v0.22.1-0.20251210080935-9a1a449c16db/go.mod h1:yWJeZ2MMaXNIFckuMjw2mlyac4FdP8MEdCM9phw3BRA= +github.com/crypto-org-chain/ethermint v0.22.1-0.20251212021209-7da2d575eebe h1:6JV7cEOr7ona/MQzR1IETiZ5lVIXEPOVlEhjtPFHdKM= +github.com/crypto-org-chain/ethermint v0.22.1-0.20251212021209-7da2d575eebe/go.mod h1:yWJeZ2MMaXNIFckuMjw2mlyac4FdP8MEdCM9phw3BRA= 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= diff --git a/gomod2nix.toml b/gomod2nix.toml index 774ee3b2e5..355f0f64de 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -324,8 +324,8 @@ schema = 3 version = "v0.2.2" hash = "sha256-0MLfSJKdeK3Z7tWAXTdzwB4091dmyxIX38S5SKH5QAw=" [mod."github.com/evmos/ethermint"] - version = "v0.22.1-0.20251210080935-9a1a449c16db" - hash = "sha256-vQSzciBZQkWt9YvE3Aap23vVDwbjJJwY0myl+yYnous=" + version = "v0.22.1-0.20251212021209-7da2d575eebe" + hash = "sha256-CZOdrNnV86ckdl3RJyaWjovjjai8U2uutk3+Tks04+c=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.17.0" diff --git a/integration_tests/contracts/contracts/TestAccessList.sol b/integration_tests/contracts/contracts/TestAccessList.sol new file mode 100644 index 0000000000..f66e1fecca --- /dev/null +++ b/integration_tests/contracts/contracts/TestAccessList.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +contract TestAccessList { + uint256 public slotA; // slot 0 + uint256 public slotB; // slot 1 + mapping(address => uint256) public balances; // slot 2 + keccak(addr,2) + + function touchSlots(uint256 a, uint256 b) public { + slotA = a; + slotB = b; + balances[msg.sender] = a + b; + } +} \ No newline at end of file diff --git a/integration_tests/test_basic.py b/integration_tests/test_basic.py index c90f30c8f1..8ed7c032b1 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -1123,3 +1123,70 @@ def test_block_tx_properties(cronos): assert data["price"] > 0 assert data["gas"] == 3633 assert data["sig"] == bytes.fromhex("8e091b5e") + + +def test_access_list(cronos): + """ + Send a transaction and check that the node preserves the access list + """ + w3 = cronos.w3 + + to_address = ADDRS["community"] + storage_key = "0x0000000000000000000000000000000000000000000000000000000000000000" + access_list = [ + { + "address": to_address, + "storageKeys": [storage_key], + }, + ] + + txhash = w3.eth.send_transaction( + { + "from": ADDRS["validator"], + "to": to_address, + "value": 1000, + "accessList": access_list, + } + ) + receipt = w3.eth.wait_for_transaction_receipt(txhash) + assert receipt.status == 1 + rpc_tx = w3.eth.get_transaction(txhash) + assert rpc_tx.accessList == access_list + + # Deploy a contract and call a function hitting multiple slots + contract = deploy_contract( + w3, + CONTRACTS["TestAccessList"], + ) + + tx_data = contract.functions.touchSlots(123, 456).build_transaction( + {"from": ADDRS["validator"]} + )["data"] + + tx = { + "from": ADDRS["validator"], + "to": contract.address, + "data": tx_data, + "value": hex(0), + "gas": hex(500000), + } + + access_list = w3.provider.make_request("eth_createAccessList", [tx, "latest"]) + assert ( + access_list["result"]["accessList"][0]["address"].lower() + == contract.address.lower() + ) + storage_keys = access_list["result"]["accessList"][0]["storageKeys"] + assert len(storage_keys) == 3 + assert ( + "0x0000000000000000000000000000000000000000000000000000000000000000".lower() + in [k.lower() for k in storage_keys] + ) + assert ( + "0x0000000000000000000000000000000000000000000000000000000000000001".lower() + in [k.lower() for k in storage_keys] + ) + assert ( + "0x30939a3db93623b4b889c7802487ba975ac3bc59182f4c2dff55b302788334ec".lower() + in [k.lower() for k in storage_keys] + ) diff --git a/integration_tests/utils.py b/integration_tests/utils.py index 149b2c4929..d46e7b0dcd 100644 --- a/integration_tests/utils.py +++ b/integration_tests/utils.py @@ -71,6 +71,7 @@ "Utils": "Utils.sol", "Counter": "Counter.sol", "TestEip2935": "TestEip2935.sol", + "TestAccessList": "TestAccessList.sol", }