Skip to content

chore: include eth_createAccessList as an unsupported method #3852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions docs/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions docs/rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand Down
3 changes: 3 additions & 0 deletions packages/relay/src/lib/config/methodConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,7 @@ export const methodConfiguration: MethodRateLimitConfiguration = {
eth_getProof: {
total: tier2rateLimit,
},
eth_createAccessList: {
total: tier2rateLimit,
},
};
18 changes: 18 additions & 0 deletions packages/relay/src/lib/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
8 changes: 8 additions & 0 deletions packages/relay/tests/lib/eth/eth_common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 6 additions & 0 deletions packages/relay/tests/lib/openrpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion packages/server/tests/acceptance/conformityTests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 6 additions & 2 deletions packages/server/tests/acceptance/rpc_batch2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/server/tests/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 15 additions & 0 deletions packages/server/tests/integration/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('/', {
Expand Down
Loading