Add payload to a cache for later signing

This commit is contained in:
Eitan Seri- Levi
2026-02-03 17:27:58 -08:00
parent 7cf4eb0396
commit 50dde1585c
11 changed files with 286 additions and 37 deletions

View File

@@ -140,7 +140,8 @@ pub fn build_response_v4<T: BeaconChainTypes>(
.to_ref()
.fork_name(&chain.spec)
.map_err(inconsistent_fork_rejection)?;
let consensus_block_value_wei = Uint256::from(consensus_block_value) * Uint256::from(1_000_000_000u64);
let consensus_block_value_wei =
Uint256::from(consensus_block_value) * Uint256::from(1_000_000_000u64);
match accept_header {
Some(api_types::Accept::Ssz) => Response::builder()

View File

@@ -1,4 +1,6 @@
use crate::produce_block::{produce_blinded_block_v2, produce_block_v2, produce_block_v3, produce_block_v4};
use crate::produce_block::{
produce_blinded_block_v2, produce_block_v2, produce_block_v3, produce_block_v4,
};
use crate::task_spawner::{Priority, TaskSpawner};
use crate::utils::{
AnyVersionFilter, ChainFilter, EthV1Filter, NetworkTxFilter, NotWhileSyncingFilter,

View File

@@ -3799,6 +3799,19 @@ impl ApiTester {
);
assert!(!metadata.consensus_block_value.is_zero());
// Verify that the execution payload envelope is cached for local building.
// The envelope is stored in the pending cache until publishing.
let block_root = block.tree_hash_root();
let envelope = self
.chain
.pending_payload_envelopes
.read()
.get(&block_root)
.cloned()
.expect("envelope should exist in pending cache for local building");
assert_eq!(envelope.beacon_block_root, block_root);
assert_eq!(envelope.slot, slot);
// Sign and publish the block
let signed_block = block.sign(&sk, &fork, genesis_validators_root, &self.chain.spec);
let signed_block_request =