Skip to content

Commit dad09ab

Browse files
AlexeyAkhunovAlex Sharp
andauthored
[beta] Reverse order of arguments in eth_createAccessList (#3067)
* Reverse order of arguments in eth_createAccessList (#3066) Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local> * More info about remote RPC Daemon state cache + eth_createAccessList (#3068) Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
1 parent 410bb0d commit dad09ab

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

cmd/rpcdaemon/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ The daemon should respond with something like:
6464
INFO [date-time] HTTP endpoint opened url=localhost:8545...
6565
```
6666

67+
When RPC daemon runs remotely, by default it maintains a state cache, which is updated every time when Erigon
68+
imports a new block. When state cache is reasonably warm, it allows such remote RPC daemon to execute queries
69+
related to `latest` block (i.e. to current state) with comparable performance to a local RPC daemon
70+
(around 2x slower vs 10x slower without state cache). Since there can be multiple such RPC daemons per one
71+
Erigon node, it may scale well for some workloads that are heavy on the current state queries.
72+
6773
### Healthcheck
6874

6975
Running the daemon also opens an endpoint `/health` that provides a basic health check.
@@ -191,6 +197,7 @@ The following table shows the current implementation status of Erigon's RPC daem
191197
| eth_getStorageAt | Yes | |
192198
| eth_call | Yes | |
193199
| eth_callBundle | Yes | |
200+
| eth_createAccessList | Yes |
194201
| | | |
195202
| eth_newFilter | - | not yet implemented |
196203
| eth_newBlockFilter | - | not yet implemented |

cmd/rpcdaemon/commands/eth_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type EthAPI interface {
8181
Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
8282
SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
8383
GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*interface{}, error)
84-
CreateAccessList(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, args ethapi.CallArgs) (*accessListResult, error)
84+
CreateAccessList(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash) (*accessListResult, error)
8585

8686
// Mining related (see ./eth_mining.go)
8787
Coinbase(ctx context.Context) (common.Address, error)

cmd/rpcdaemon/commands/eth_call.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ type accessListResult struct {
295295
// CreateAccessList implements eth_createAccessList. It creates an access list for the given transaction.
296296
// If the accesslist creation fails an error is returned.
297297
// If the transaction itself fails, an vmErr is returned.
298-
func (api *APIImpl) CreateAccessList(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, args ethapi.CallArgs) (*accessListResult, error) {
298+
func (api *APIImpl) CreateAccessList(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash) (*accessListResult, error) {
299299
tx, err := api.db.BeginRo(ctx)
300300
if err != nil {
301301
return nil, err

0 commit comments

Comments
 (0)