Skip to content

Commit 3267ce3

Browse files
committed
Store full signed bid
1 parent 47998e4 commit 3267ce3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

fork_choice_store/src/store.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ use types::{
5454
primitives::ColumnIndex,
5555
},
5656
gloas::containers::{
57-
DataColumnSidecar as GloasDataColumnSidecar, ExecutionPayloadBid,
58-
PayloadAttestationMessage, SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope,
57+
DataColumnSidecar as GloasDataColumnSidecar, PayloadAttestationMessage,
58+
SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope,
5959
},
6060
nonstandard::{BlobSidecarWithId, DataColumnSidecarWithId, PayloadStatus, Phase, WithStatus},
6161
phase0::{
@@ -234,7 +234,7 @@ pub struct Store<P: Preset, S: Storage<P>> {
234234
(Slot, H256, ColumnIndex),
235235
ContiguousList<KzgCommitment, P::MaxBlobCommitmentsPerBlock>,
236236
>,
237-
accepted_payload_bids: HashMap<Slot, HashMap<ValidatorIndex, ExecutionPayloadBid>>,
237+
accepted_payload_bids: HashMap<Slot, HashMap<ValidatorIndex, SignedExecutionPayloadBid>>,
238238
blob_cache: BlobCache<P>,
239239
state_cache: Arc<StateCacheProcessor<P>>,
240240
storage: Arc<S>,
@@ -1359,10 +1359,10 @@ impl<P: Preset, S: Storage<P>> Store<P, S> {
13591359
// > this bid is the highest value bid seen for the corresponding slot and the given parent block hash.
13601360
if let Some(highest_bid) = payload_bids
13611361
.values()
1362-
.filter(|b| b.parent_block_hash == bid.parent_block_hash)
1363-
.max_by_key(|bid| bid.value)
1362+
.filter(|b| b.message.parent_block_hash == bid.parent_block_hash)
1363+
.max_by_key(|b| b.message.value)
13641364
{
1365-
if bid.value <= highest_bid.value {
1365+
if bid.value <= highest_bid.message.value {
13661366
// This bid doesn't have a higher value than the existing bid
13671367
return Ok(ExecutionPayloadBidAction::Ignore(true));
13681368
}
@@ -2437,8 +2437,8 @@ impl<P: Preset, S: Storage<P>> Store<P, S> {
24372437
// [IGNORE] The sidecar's beacon_block_root has been seen via a valid signed execution payload bid.
24382438
let Some(payload_bid) = self.accepted_payload_bids.get(&slot).and_then(|bids| {
24392439
bids.values()
2440-
.filter(|bid| bid.parent_block_root == block_root)
2441-
.max_by_key(|bid| bid.value)
2440+
.filter(|bid| bid.message.parent_block_root == block_root)
2441+
.max_by_key(|bid| bid.message.value)
24422442
}) else {
24432443
return Ok(DataColumnSidecarAction::DelayUntilState(
24442444
data_column_sidecar,
@@ -2449,7 +2449,7 @@ impl<P: Preset, S: Storage<P>> Store<P, S> {
24492449
// [REJECT] The hash of the sidecar's kzg_commitments matches the blob_kzg_commitments_root in the corresponding builder's bid for sidecar.beacon_block_root.
24502450
ensure!(
24512451
data_column_sidecar.kzg_commitments().hash_tree_root()
2452-
== payload_bid.blob_kzg_commitments_root,
2452+
== payload_bid.message.blob_kzg_commitments_root,
24532453
Error::DataColumnSidecarInvalidKzgCommitments {
24542454
data_column_sidecar
24552455
}
@@ -3005,7 +3005,7 @@ impl<P: Preset, S: Storage<P>> Store<P, S> {
30053005
let bid = payload_bid.message;
30063006
let accepted_bids = self.accepted_payload_bids.entry(bid.slot).or_default();
30073007

3008-
accepted_bids.insert(bid.builder_index, payload_bid.message);
3008+
accepted_bids.insert(bid.builder_index, *payload_bid);
30093009
}
30103010

30113011
pub fn apply_data_column_sidecar(&mut self, data_sidecar: Arc<DataColumnSidecar<P>>) {

0 commit comments

Comments
 (0)