Skip to content

Commit 8c7fbc9

Browse files
authored
chore: include eth_createAccessList as an unsupported method (#3852)
Signed-off-by: Luis Mastrangelo <[email protected]>
1 parent 5ed656a commit 8c7fbc9

File tree

10 files changed

+68
-3
lines changed

10 files changed

+68
-3
lines changed

docs/openrpc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,14 @@
12441244
"result": {
12451245
"$ref": "#/components/schemas/unsupportedError"
12461246
}
1247+
},
1248+
{
1249+
"name": "eth_createAccessList",
1250+
"summary": "Always returns UNSUPPORTED_METHOD error.",
1251+
"params": [],
1252+
"result": {
1253+
"$ref": "#/components/schemas/unsupportedError"
1254+
}
12471255
}
12481256
],
12491257
"components": {

docs/rpc-api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Below is a comprehensive table of all Ethereum JSON-RPC methods from the [Ethere
8686
| [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) |
8787
| [eth_getLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) | **Implemented** | Mirror Node | Subject to Mirror Node query limits |
8888
| [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 |
89+
| [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 |
8990
| [eth_getStorageAt](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) | **Implemented** | Mirror Node | |
9091
| [eth_getTransactionByBlockHashAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblockhashandindex) | **Implemented** | Mirror Node | |
9192
| [eth_getTransactionByBlockNumberAndIndex](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblocknumberandindex) | **Implemented** | Mirror Node | |

packages/relay/src/lib/config/methodConfiguration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,7 @@ export const methodConfiguration: MethodRateLimitConfiguration = {
175175
eth_getProof: {
176176
total: tier2rateLimit,
177177
},
178+
eth_createAccessList: {
179+
total: tier2rateLimit,
180+
},
178181
};

packages/relay/src/lib/eth.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,4 +1141,22 @@ export class EthImpl implements Eth {
11411141
}
11421142
return predefined.UNSUPPORTED_METHOD;
11431143
}
1144+
1145+
/**
1146+
* Always returns UNSUPPORTED_METHOD error.
1147+
*
1148+
* @rpcMethod Exposed as eth_createAccessList RPC endpoint
1149+
* @rpcParamLayoutConfig decorated method parameter layout
1150+
*
1151+
* @param {RequestDetails} requestDetails - Details about the request for logging and tracking
1152+
* @returns {JsonRpcError} An error indicating the method is not supported
1153+
*/
1154+
@rpcMethod
1155+
@rpcParamLayoutConfig(RPC_LAYOUT.REQUEST_DETAILS_ONLY)
1156+
createAccessList(requestDetails: RequestDetails): JsonRpcError {
1157+
if (this.logger.isLevelEnabled('trace')) {
1158+
this.logger.trace(`${requestDetails.formattedRequestId} createAccessList()`);
1159+
}
1160+
return predefined.UNSUPPORTED_METHOD;
1161+
}
11441162
}

packages/relay/tests/lib/eth/eth_common.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ describe('@ethCommon', async function () {
9090
expect(result.message).to.be.equal('Unsupported JSON-RPC method');
9191
});
9292

93+
it(`should execute "eth_createAccessList`, async function () {
94+
const result = relay.eth().createAccessList(requestDetails);
95+
expect(result).to.have.property('code');
96+
expect(result.code).to.be.equal(-32601);
97+
expect(result).to.have.property('message');
98+
expect(result.message).to.be.equal('Unsupported JSON-RPC method');
99+
});
100+
93101
it('should execute "eth_blobBaseFee"', async function () {
94102
const result = relay.eth().blobBaseFee(requestDetails);
95103
expect(result).to.have.property('code');

packages/relay/tests/lib/openrpc.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,12 @@ describe('Open RPC Specification', function () {
552552
validateResponseSchema(methodsResponseSchema.eth_getProof, response);
553553
});
554554

555+
it('should execute "eth_createAccessList"', async function () {
556+
const response = ethImpl.createAccessList(requestDetails);
557+
558+
validateResponseSchema(methodsResponseSchema.eth_createAccessList, response);
559+
});
560+
555561
it('should execute "net_listening"', function () {
556562
const response = relay.net().listening();
557563

packages/server/tests/acceptance/conformityTests.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ describe('@api-conformity', async function () {
379379
directory === 'eth_getLogs' ||
380380
directory === 'eth_call' ||
381381
directory === 'eth_estimateGas' ||
382-
directory === 'eth_getProof'
382+
directory === 'eth_getProof' ||
383+
directory === 'eth_createAccessList'
383384
) {
384385
return;
385386
}

packages/server/tests/acceptance/rpc_batch2.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ describe('@api-batch-2 RPC Server Acceptance Tests', function () {
127127
// Note: There is currently a caching solution for eth_blockNumber that stores the block number.
128128
// This loop is designed to poll for the latest block number until it is correctly updated.
129129
for (let i = 0; i < 5; i++) {
130-
blockNumAfterCreateChildTx = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_BLOCK_NUMBER, [], requestId);
130+
blockNumAfterCreateChildTx = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_BLOCK_NUMBER, [], requestId);
131131
if (blockNumAfterCreateChildTx > blockNumBeforeCreateChildTx) {
132-
console.log("Block number updated succesfully")
132+
console.log('Block number updated succesfully');
133133
break;
134134
}
135135
await Utils.wait(1500);
@@ -746,6 +746,10 @@ describe('@api-batch-2 RPC Server Acceptance Tests', function () {
746746
it('should not support "eth_getProof"', async function () {
747747
await relay.callUnsupported(RelayCalls.ETH_ENDPOINTS.ETH_GET_PROOF, [], requestId);
748748
});
749+
750+
it('should not support "eth_createAccessList"', async function () {
751+
await relay.callUnsupported(RelayCalls.ETH_ENDPOINTS.ETH_CREATE_ACCESS_LIST, [], requestId);
752+
});
749753
});
750754

751755
describe('eth_getCode', () => {

packages/server/tests/helpers/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const ETH_ENDPOINTS = {
4949
NET_PEER_COUNT: 'net_peerCount',
5050
ETH_SIGN_TYPED_DATA: 'eth_signTypedData',
5151
ETH_GET_PROOF: 'eth_getProof',
52+
ETH_CREATE_ACCESS_LIST: 'eth_createAccessList',
5253
ETH_NEW_FILTER: 'eth_newFilter',
5354
ETH_NEW_BLOCK_FILTER: 'eth_newBlockFilter',
5455
ETH_NEW_PENDING_TRANSACTION_FILTER: 'eth_newPendingTransactionFilter',

packages/server/tests/integration/server.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,21 @@ describe('RPC Server', function () {
448448
}
449449
});
450450

451+
it('should execute "eth_createAccessList"', async function () {
452+
try {
453+
await testClient.post('/', {
454+
id: '2',
455+
jsonrpc: '2.0',
456+
method: RelayCalls.ETH_ENDPOINTS.ETH_CREATE_ACCESS_LIST,
457+
params: [],
458+
});
459+
460+
Assertions.expectedError();
461+
} catch (error: any) {
462+
BaseTest.unsupportedJsonRpcMethodChecks(error.response);
463+
}
464+
});
465+
451466
it('should execute "eth_coinbase"', async function () {
452467
try {
453468
await testClient.post('/', {

0 commit comments

Comments
 (0)