Append client version info to graffiti (#7558)

* #7201


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>

Co-Authored-By: Jimmy Chen <jimmy@sigmaprime.io>

Co-Authored-By: Tan Chee Keong <tanck2005@gmail.com>
This commit is contained in:
chonghe
2025-12-16 11:19:28 +08:00
committed by GitHub
parent afa6457acf
commit 86c2b7cfbe
14 changed files with 392 additions and 47 deletions

View File

@@ -2,6 +2,7 @@ use crate::blob_verification::GossipVerifiedBlob;
use crate::block_verification_types::{AsBlock, RpcBlock};
use crate::custody_context::NodeCustodyType;
use crate::data_column_verification::CustodyDataColumn;
use crate::graffiti_calculator::GraffitiSettings;
use crate::kzg_utils::build_data_column_sidecars;
use crate::observed_operations::ObservationOutcome;
pub use crate::persisted_beacon_chain::PersistedBeaconChain;
@@ -23,7 +24,7 @@ use bls::get_withdrawal_credentials;
use bls::{
AggregateSignature, Keypair, PublicKey, PublicKeyBytes, SecretKey, Signature, SignatureBytes,
};
use eth2::types::SignedBlockContentsTuple;
use eth2::types::{GraffitiPolicy, SignedBlockContentsTuple};
use execution_layer::test_utils::generate_genesis_header;
use execution_layer::{
ExecutionLayer,
@@ -943,6 +944,8 @@ where
// BeaconChain errors out with `DuplicateFullyImported`. Vary the graffiti so that we produce
// different blocks each time.
let graffiti = Graffiti::from(self.rng.lock().random::<[u8; 32]>());
let graffiti_settings =
GraffitiSettings::new(Some(graffiti), Some(GraffitiPolicy::PreserveUserGraffiti));
let randao_reveal = self.sign_randao_reveal(&state, proposer_index, slot);
@@ -956,7 +959,7 @@ where
None,
slot,
randao_reveal,
Some(graffiti),
graffiti_settings,
ProduceBlockVerification::VerifyRandao,
builder_boost_factor,
BlockProductionVersion::V3,
@@ -1000,6 +1003,8 @@ where
// BeaconChain errors out with `DuplicateFullyImported`. Vary the graffiti so that we produce
// different blocks each time.
let graffiti = Graffiti::from(self.rng.lock().random::<[u8; 32]>());
let graffiti_settings =
GraffitiSettings::new(Some(graffiti), Some(GraffitiPolicy::PreserveUserGraffiti));
let randao_reveal = self.sign_randao_reveal(&state, proposer_index, slot);
@@ -1010,7 +1015,7 @@ where
None,
slot,
randao_reveal,
Some(graffiti),
graffiti_settings,
ProduceBlockVerification::VerifyRandao,
None,
BlockProductionVersion::FullV2,
@@ -1059,6 +1064,8 @@ where
// BeaconChain errors out with `DuplicateFullyImported`. Vary the graffiti so that we produce
// different blocks each time.
let graffiti = Graffiti::from(self.rng.lock().random::<[u8; 32]>());
let graffiti_settings =
GraffitiSettings::new(Some(graffiti), Some(GraffitiPolicy::PreserveUserGraffiti));
let randao_reveal = self.sign_randao_reveal(&state, proposer_index, slot);
@@ -1071,7 +1078,7 @@ where
None,
slot,
randao_reveal,
Some(graffiti),
graffiti_settings,
ProduceBlockVerification::VerifyRandao,
None,
BlockProductionVersion::FullV2,