From 08a72e1818a4ca8fc839ffbac2ab9418e9fe5163 Mon Sep 17 00:00:00 2001 From: Luis Mastrangelo Date: Sat, 14 Jun 2025 01:40:19 +0200 Subject: [PATCH 1/2] Include `eth_createAccessList` as an unsupported method Signed-off-by: Luis Mastrangelo --- docs/openrpc.json | 8 ++++++++ docs/rpc-api.md | 1 + .../src/lib/config/methodConfiguration.ts | 3 +++ packages/relay/src/lib/eth.ts | 18 ++++++++++++++++++ .../relay/tests/lib/eth/eth_common.spec.ts | 8 ++++++++ packages/relay/tests/lib/openrpc.spec.ts | 6 ++++++ .../tests/acceptance/conformityTests.spec.ts | 3 ++- .../server/tests/acceptance/rpc_batch2.spec.ts | 8 ++++++-- packages/server/tests/helpers/constants.ts | 1 + .../server/tests/integration/server.spec.ts | 15 +++++++++++++++ 10 files changed, 68 insertions(+), 3 deletions(-) diff --git a/docs/openrpc.json b/docs/openrpc.json index 338a49173e..e898abc6f5 100644 --- a/docs/openrpc.json +++ b/docs/openrpc.json @@ -1244,6 +1244,14 @@ "result": { "$ref": "#/components/schemas/unsupportedError" } + }, + { + "name": "eth_createAccessList", + "summary": "Always returns UNSUPPORTED_METHOD error.", + "params": [], + "result": { + "$ref": "#/components/schemas/unsupportedError" + } } ], "components": { diff --git a/docs/rpc-api.md b/docs/rpc-api.md index 535750c712..f4355f2248 100644 --- a/docs/rpc-api.md +++ b/docs/rpc-api.md @@ -86,6 +86,7 @@ Below is a comprehensive table of all Ethereum JSON-RPC methods from the [Ethere | [eth_getFilterLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) | **Implemented** | Mirror Node | Filter state stored in configurable cache (LRU or Redis) | | [eth_getLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) | **Implemented** | Mirror Node | Subject to Mirror Node query limits | | [eth_getProof](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getproof) | **Implemented** - Returns `-32601` (Method not supported) | N/A | Merkle proofs not supported | +| [eth_createAccessList](https://ethereum.github.io/execution-apis/docs/reference/eth_createaccesslist) | **Implemented** - Returns `-32601` (Method not supported) | N/A | Generates an access list for a transaction | | [eth_getStorageAt](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) | **Implemented** | Mirror Node | | | [eth_getTransactionByBlockHashAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblockhashandindex) | **Implemented** | Mirror Node | | | [eth_getTransactionByBlockNumberAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblocknumberandindex) | **Implemented** | Mirror Node | | diff --git a/packages/relay/src/lib/config/methodConfiguration.ts b/packages/relay/src/lib/config/methodConfiguration.ts index 1808ca999f..387c53f422 100644 --- a/packages/relay/src/lib/config/methodConfiguration.ts +++ b/packages/relay/src/lib/config/methodConfiguration.ts @@ -175,4 +175,7 @@ export const methodConfiguration: MethodRateLimitConfiguration = { eth_getProof: { total: tier2rateLimit, }, + eth_createAccessList: { + total: tier2rateLimit, + }, }; diff --git a/packages/relay/src/lib/eth.ts b/packages/relay/src/lib/eth.ts index f4c6af3e07..4f62dcaecd 100644 --- a/packages/relay/src/lib/eth.ts +++ b/packages/relay/src/lib/eth.ts @@ -1141,4 +1141,22 @@ export class EthImpl implements Eth { } return predefined.UNSUPPORTED_METHOD; } + + /** + * Always returns UNSUPPORTED_METHOD error. + * + * @rpcMethod Exposed as eth_createAccessList RPC endpoint + * @rpcParamLayoutConfig decorated method parameter layout + * + * @param {RequestDetails} requestDetails - Details about the request for logging and tracking + * @returns {JsonRpcError} An error indicating the method is not supported + */ + @rpcMethod + @rpcParamLayoutConfig(RPC_LAYOUT.REQUEST_DETAILS_ONLY) + createAccessList(requestDetails: RequestDetails): JsonRpcError { + if (this.logger.isLevelEnabled('trace')) { + this.logger.trace(`${requestDetails.formattedRequestId} createAccessList()`); + } + return predefined.UNSUPPORTED_METHOD; + } } diff --git a/packages/relay/tests/lib/eth/eth_common.spec.ts b/packages/relay/tests/lib/eth/eth_common.spec.ts index 3502a0650b..e5aee577bf 100644 --- a/packages/relay/tests/lib/eth/eth_common.spec.ts +++ b/packages/relay/tests/lib/eth/eth_common.spec.ts @@ -90,6 +90,14 @@ describe('@ethCommon', async function () { expect(result.message).to.be.equal('Unsupported JSON-RPC method'); }); + it(`should execute "eth_createAccessList`, async function () { + const result = relay.eth().createAccessList(requestDetails); + expect(result).to.have.property('code'); + expect(result.code).to.be.equal(-32601); + expect(result).to.have.property('message'); + expect(result.message).to.be.equal('Unsupported JSON-RPC method'); + }); + it('should execute "eth_blobBaseFee"', async function () { const result = relay.eth().blobBaseFee(requestDetails); expect(result).to.have.property('code'); diff --git a/packages/relay/tests/lib/openrpc.spec.ts b/packages/relay/tests/lib/openrpc.spec.ts index b4920293cc..05e56738e2 100644 --- a/packages/relay/tests/lib/openrpc.spec.ts +++ b/packages/relay/tests/lib/openrpc.spec.ts @@ -552,6 +552,12 @@ describe('Open RPC Specification', function () { validateResponseSchema(methodsResponseSchema.eth_getProof, response); }); + it('should execute "eth_createAccessList"', async function () { + const response = ethImpl.createAccessList(requestDetails); + + validateResponseSchema(methodsResponseSchema.eth_createAccessList, response); + }); + it('should execute "net_listening"', function () { const response = relay.net().listening(); diff --git a/packages/server/tests/acceptance/conformityTests.spec.ts b/packages/server/tests/acceptance/conformityTests.spec.ts index 136586436f..35cb695c6d 100644 --- a/packages/server/tests/acceptance/conformityTests.spec.ts +++ b/packages/server/tests/acceptance/conformityTests.spec.ts @@ -379,7 +379,8 @@ describe('@api-conformity', async function () { directory === 'eth_getLogs' || directory === 'eth_call' || directory === 'eth_estimateGas' || - directory === 'eth_getProof' + directory === 'eth_getProof' || + directory === 'eth_createAccessList' ) { return; } diff --git a/packages/server/tests/acceptance/rpc_batch2.spec.ts b/packages/server/tests/acceptance/rpc_batch2.spec.ts index c8b064cc18..faff6b72f9 100644 --- a/packages/server/tests/acceptance/rpc_batch2.spec.ts +++ b/packages/server/tests/acceptance/rpc_batch2.spec.ts @@ -127,9 +127,9 @@ describe('@api-batch-2 RPC Server Acceptance Tests', function () { // Note: There is currently a caching solution for eth_blockNumber that stores the block number. // This loop is designed to poll for the latest block number until it is correctly updated. for (let i = 0; i < 5; i++) { - blockNumAfterCreateChildTx = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_BLOCK_NUMBER, [], requestId); + blockNumAfterCreateChildTx = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_BLOCK_NUMBER, [], requestId); if (blockNumAfterCreateChildTx > blockNumBeforeCreateChildTx) { - console.log("Block number updated succesfully") + console.log('Block number updated succesfully'); break; } await Utils.wait(1500); @@ -746,6 +746,10 @@ describe('@api-batch-2 RPC Server Acceptance Tests', function () { it('should not support "eth_getProof"', async function () { await relay.callUnsupported(RelayCalls.ETH_ENDPOINTS.ETH_GET_PROOF, [], requestId); }); + + it('should not support "eth_createAccessList"', async function () { + await relay.callUnsupported(RelayCalls.ETH_ENDPOINTS.ETH_CREATE_ACCESS_LIST, [], requestId); + }); }); describe('eth_getCode', () => { diff --git a/packages/server/tests/helpers/constants.ts b/packages/server/tests/helpers/constants.ts index 771fc8df5b..c122837ab3 100644 --- a/packages/server/tests/helpers/constants.ts +++ b/packages/server/tests/helpers/constants.ts @@ -49,6 +49,7 @@ const ETH_ENDPOINTS = { NET_PEER_COUNT: 'net_peerCount', ETH_SIGN_TYPED_DATA: 'eth_signTypedData', ETH_GET_PROOF: 'eth_getProof', + ETH_CREATE_ACCESS_LIST: 'eth_createAccessList', ETH_NEW_FILTER: 'eth_newFilter', ETH_NEW_BLOCK_FILTER: 'eth_newBlockFilter', ETH_NEW_PENDING_TRANSACTION_FILTER: 'eth_newPendingTransactionFilter', diff --git a/packages/server/tests/integration/server.spec.ts b/packages/server/tests/integration/server.spec.ts index 0c3d38d346..ad8e6b35de 100644 --- a/packages/server/tests/integration/server.spec.ts +++ b/packages/server/tests/integration/server.spec.ts @@ -448,6 +448,21 @@ describe('RPC Server', function () { } }); + it('should execute "eth_createAccessList"', async function () { + try { + await testClient.post('/', { + id: '2', + jsonrpc: '2.0', + method: RelayCalls.ETH_ENDPOINTS.ETH_CREATE_ACCESS_LIST, + params: [], + }); + + Assertions.expectedError(); + } catch (error: any) { + BaseTest.unsupportedJsonRpcMethodChecks(error.response); + } + }); + it('should execute "eth_coinbase"', async function () { try { await testClient.post('/', { From 100e6b58e0fc983fd6df27a9768d953ca7a28b8a Mon Sep 17 00:00:00 2001 From: Luis Mastrangelo Date: Mon, 16 Jun 2025 15:38:07 +0200 Subject: [PATCH 2/2] Apply Nikky's suggestion to properly format OpenRPC docs Signed-off-by: Luis Mastrangelo --- docs/rpc-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rpc-api.md b/docs/rpc-api.md index f4355f2248..040ad1eddb 100644 --- a/docs/rpc-api.md +++ b/docs/rpc-api.md @@ -86,7 +86,7 @@ Below is a comprehensive table of all Ethereum JSON-RPC methods from the [Ethere | [eth_getFilterLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) | **Implemented** | Mirror Node | Filter state stored in configurable cache (LRU or Redis) | | [eth_getLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) | **Implemented** | Mirror Node | Subject to Mirror Node query limits | | [eth_getProof](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getproof) | **Implemented** - Returns `-32601` (Method not supported) | N/A | Merkle proofs not supported | -| [eth_createAccessList](https://ethereum.github.io/execution-apis/docs/reference/eth_createaccesslist) | **Implemented** - Returns `-32601` (Method not supported) | N/A | Generates an access list for a transaction | +| [eth_createAccessList](https://ethereum.github.io/execution-apis/docs/reference/eth_createaccesslist) | **Implemented** - Returns `-32601` (Method not supported) | N/A | Generates an access list for a transaction | | [eth_getStorageAt](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) | **Implemented** | Mirror Node | | | [eth_getTransactionByBlockHashAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblockhashandindex) | **Implemented** | Mirror Node | | | [eth_getTransactionByBlockNumberAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblocknumberandindex) | **Implemented** | Mirror Node | |