https://github.com/rjected/execution-payload-builder
Builds an ExecutionPayload from a JSON Block obtained from RPC
https://github.com/rjected/execution-payload-builder
Last synced: about 1 year ago
JSON representation
Builds an ExecutionPayload from a JSON Block obtained from RPC
- Host: GitHub
- URL: https://github.com/rjected/execution-payload-builder
- Owner: Rjected
- Created: 2023-10-31T00:51:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-03T02:55:47.000Z (over 1 year ago)
- Last Synced: 2025-03-31T08:12:47.694Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 88.9 KB
- Stars: 16
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# execution-payload-builder
Builds an `ExecutionPayload` from a JSON `Block` obtained from RPC.
## Usage
For example, using raw `cast rpc` output:
```
cast rpc eth_getBlockByHash '["0x58fee1cac2a8ef87a84e6a77cef27b4935e1cf8ae8320afdd5c176ef17b5d94a", true]' --raw > ~/devnet-43510-1.json
```
Then run:
```
cargo run -- --path ~/devnet-43510-1.json
```
It will spit out a `cast rpc engine_newPayloadV3` command:
```
cargo run -- --path ~/devnet-43511-2.json --jwt-secret blah --rpc-url foo
Compiling execution-payload-builder v0.1.0 (/Users/dan/projects/execution-payload-builder)
Finished dev [unoptimized + debuginfo] target(s) in 1.50s
Running `target/debug/execution-payload-builder --path /Users/dan/devnet-43511-2.json --jwt-secret blah --rpc-url foo`
cast rpc --rpc-url foo --jwt-secret blah engine_newPayloadV3 --raw '[{"parentHash":"0x58fee1cac2a8ef87a84e6a77cef27b4935e1cf8ae8320afdd5c176ef17b5d94a","feeRecipient":"0xf97e180c050e5ab072211ad2c213eb5aee4df134","stateRoot":"0x110ab4c2a60046b0495821b7205e9779e5c82e272578dcf6da2f99e151d232be","receiptsRoot":"0xba987831fa678a1548ce8a6accab6f97cf8018f408e2ae2db73d119fdb4ac4e1","logsBloom":"0x002000000000000000000000800000020000000000001000080000800000000000000800
... response is huge
```
For example, this can be piped directly into `sh` to run:
```sh
cargo run -- --path ~/devnet-43511-2.json --jwt-secret --rpc-url http://127.0.0.1:8551 | sh
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target/debug/execution-payload-builder --path /Users/dan/devnet-43511-2.json --jwt-secret --rpc-url 'http://127.0.0.1:8551'`
{"status":"VALID","latestValidHash":"0xad3eea923bcc1abe60ec666f47a8fcf13f5bc37fa6a36f1da247d870103262ad","validationError":null}
```