mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
add consts
This commit is contained in:
@@ -15,6 +15,7 @@ use state_processing::{
|
|||||||
use state_processing::{VerifyOperation, state_advance::complete_state_advance};
|
use state_processing::{VerifyOperation, state_advance::complete_state_advance};
|
||||||
use tracing::{Span, debug, debug_span, error, instrument, trace, warn};
|
use tracing::{Span, debug, debug_span, error, instrument, trace, warn};
|
||||||
use tree_hash::TreeHash;
|
use tree_hash::TreeHash;
|
||||||
|
use types::consts::gloas::{BID_VALUE_SELF_BUILD, BUILDER_INDEX_SELF_BUILD};
|
||||||
use types::{
|
use types::{
|
||||||
Address, Attestation, AttestationElectra, AttesterSlashing, AttesterSlashingElectra,
|
Address, Attestation, AttestationElectra, AttesterSlashing, AttesterSlashingElectra,
|
||||||
BeaconBlock, BeaconBlockBodyGloas, BeaconBlockGloas, BeaconState, BlockProductionVersion,
|
BeaconBlock, BeaconBlockBodyGloas, BeaconBlockGloas, BeaconState, BlockProductionVersion,
|
||||||
@@ -147,7 +148,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
// We'll need to build out trustless/trusted bid paths.
|
// We'll need to build out trustless/trusted bid paths.
|
||||||
let (execution_payload_bid, state, payload_data) = self
|
let (execution_payload_bid, state, payload_data) = self
|
||||||
.clone()
|
.clone()
|
||||||
.produce_execution_payload_bid(state, state_root_opt, produce_at_slot, 0, u64::MAX)
|
.produce_execution_payload_bid(state, state_root_opt, produce_at_slot, BID_VALUE_SELF_BUILD, BUILDER_INDEX_SELF_BUILD)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// Part 3/3 (blocking)
|
// Part 3/3 (blocking)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ pub mod deneb {
|
|||||||
pub mod gloas {
|
pub mod gloas {
|
||||||
pub const BUILDER_INDEX_SELF_BUILD: u64 = u64::MAX;
|
pub const BUILDER_INDEX_SELF_BUILD: u64 = u64::MAX;
|
||||||
pub const BUILDER_INDEX_FLAG: u64 = 1 << 40;
|
pub const BUILDER_INDEX_FLAG: u64 = 1 << 40;
|
||||||
|
pub const BID_VALUE_SELF_BUILD: u64 = 0;
|
||||||
|
|
||||||
// Fork choice constants
|
// Fork choice constants
|
||||||
pub type PayloadStatus = u8;
|
pub type PayloadStatus = u8;
|
||||||
|
|||||||
@@ -620,7 +620,9 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// For Gloas, fetch the execution payload envelope, sign it, and publish it
|
// TODO(gloas) we only need to fetch, sign and publish the envelope in the local building case.
|
||||||
|
// Right now we always default to local building. Once we implement trustless/trusted builder logic
|
||||||
|
// we should check the bid for index == BUILDER_INDEX_SELF_BUILD
|
||||||
if fork_name.gloas_enabled() {
|
if fork_name.gloas_enabled() {
|
||||||
self_ref
|
self_ref
|
||||||
.fetch_sign_and_publish_payload_envelope(proposer_fallback, slot, &validator_pubkey)
|
.fetch_sign_and_publish_payload_envelope(proposer_fallback, slot, &validator_pubkey)
|
||||||
@@ -634,7 +636,7 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
|
|||||||
/// This should be called after the block has been published.
|
/// This should be called after the block has been published.
|
||||||
///
|
///
|
||||||
/// TODO(gloas): For multi-BN setups, we need to track which beacon node produced the block
|
/// TODO(gloas): For multi-BN setups, we need to track which beacon node produced the block
|
||||||
/// and fetch/publish the envelope from that same node. The envelope is cached per-BN,
|
/// and fetch the envelope from that same node. The envelope is cached per-BN,
|
||||||
/// so fetching from a different BN than the one that built the block will fail.
|
/// so fetching from a different BN than the one that built the block will fail.
|
||||||
/// See: https://github.com/sigp/lighthouse/pull/8313
|
/// See: https://github.com/sigp/lighthouse/pull/8313
|
||||||
#[instrument(skip_all)]
|
#[instrument(skip_all)]
|
||||||
|
|||||||
Reference in New Issue
Block a user