alloy-reth
Types and provider extensions for the reth_ Ethereum JSON-RPC namespace.
Usage
[]
= "0.2"
Version 0.2 targets the Alloy 2.4.x release series (with Alloy primitives 1.6.x).
Provider Extension
With the provider feature (enabled by default), you can use the RethApi extension trait
with any alloy provider:
use ProviderBuilder;
use RethApi;
use BlockId;
let provider = new.connect.await?;
let changes = provider
.reth_get_balance_changes_in_block
.await?;
reth_newPayload accepts standard execution data, Reth big-block data, and raw RLP blocks:
use ;
use ;
let standard = execution_data;
let big_block = big_block_data;
let raw_block = block_rlp;
provider
.reth_new_payload
.await?;
Raw RLP blocks with a merged block access list use
RethNewPayloadInput::block_rlp_with_bal(block, bal). Without a BAL, the wire format remains the
legacy bare byte string; with one, it is { "block": ..., "bal": ... }.
reth_forkchoiceUpdated sends only the forkchoice state. Payload attributes are intentionally not
part of this Reth-specific method.
Migration from 0.1
The BlockRlp(Bytes) enum variant is now BlockRlp { block, bal } so a BAL can be represented.
Use RethNewPayloadInput::block_rlp(bytes) to migrate old code, or
RethNewPayloadInput::block_rlp_with_bal(block, bal) when supplying a BAL. The block_rlp
constructor also preserves legacy bare-byte serialization.
Supported Methods
| Method | Description |
|---|---|
reth_getBalanceChangesInBlock |
Returns balance changes in a block |
reth_getBlockExecutionOutcome |
Returns the execution outcome for a block |
reth_newPayload |
Submits a new payload to the engine (extended) |
reth_forkchoiceUpdated |
Updates the forkchoice state |
Features
std— Enablestdsupport (enabled by default)provider— Enable theRethApiprovider extension trait (enabled by default)
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.