Skip to content

Commit

Permalink
chore(starknet_batcher): remove sequncer address from block builder c…
Browse files Browse the repository at this point in the history
…onfig
  • Loading branch information
ArniStarkware committed Dec 3, 2024
1 parent 271ec38 commit a474d6e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/papyrus/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"consensus.validator_id": {
"description": "The validator id of the node.",
"privacy": "Public",
"value": "0x0"
"value": "0x7c7"
},
"monitoring_gateway.collect_metrics": {
"description": "If true, collect and return metrics in the monitoring gateway.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ expression: dumped_default_config
},
"consensus.validator_id": {
"description": "The validator id of the node.",
"value": "0x0",
"value": "0x7c7",
"privacy": "Public"
},
"monitoring_gateway.collect_metrics": {
Expand Down
2 changes: 1 addition & 1 deletion crates/sequencing/papyrus_consensus/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Default for ConsensusConfig {
..Default::default()
};
Self {
validator_id: ValidatorId::default(),
validator_id: ValidatorId::from(1991_u128),
network_topic: "consensus".to_string(),
start_height: BlockNumber::default(),
num_validators: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ use tokio::task::JoinHandle;
use tracing::{debug, debug_span, error, info, trace, warn, Instrument};

// TODO(Dan, Matan): Remove these and replace with real gas prices and real sequencer address.
const TEMPORARY_SEQUENCER_ADDRESS: u16 = 1991;
const TEMPORARY_GAS_PRICES: GasPrices = GasPrices {
eth_gas_prices: GasPriceVector {
l1_gas_price: NonzeroGasPrice::MIN,
Expand Down Expand Up @@ -175,7 +174,7 @@ impl ConsensusContext for SequencerConsensusContext {
now.timestamp().try_into().expect("Failed to convert timestamp"),
),
use_kzg_da: true,
sequencer_address: ValidatorId::from(TEMPORARY_SEQUENCER_ADDRESS),
sequencer_address: proposal_init.proposer,
},
};
// TODO: Should we be returning an error?
Expand Down Expand Up @@ -354,7 +353,7 @@ impl SequencerConsensusContext {
async fn validate_current_round_proposal(
&mut self,
height: BlockNumber,
_proposer: ValidatorId,
proposer: ValidatorId,
timeout: Duration,
content_receiver: mpsc::Receiver<ProposalPart>,
fin_sender: oneshot::Sender<(ProposalContentId, ProposalFin)>,
Expand Down Expand Up @@ -385,7 +384,7 @@ impl SequencerConsensusContext {
now.timestamp().try_into().expect("Failed to convert timestamp"),
),
use_kzg_da: true,
sequencer_address: ValidatorId::from(TEMPORARY_SEQUENCER_ADDRESS),
sequencer_address: proposer,
},
};
batcher.validate_block(input).await.expect("Failed to initiate proposal validation");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::HashSet;

use futures::StreamExt;
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
use papyrus_consensus::types::ValidatorId;
use papyrus_network::network_manager::BroadcastTopicChannels;
use papyrus_protobuf::consensus::{
ProposalFin,
Expand All @@ -14,7 +15,6 @@ use papyrus_storage::test_utils::CHAIN_ID_FOR_TESTS;
use pretty_assertions::assert_eq;
use rstest::{fixture, rstest};
use starknet_api::block::{BlockHash, BlockNumber};
use starknet_api::core::ContractAddress;
use starknet_api::transaction::TransactionHash;
use starknet_integration_tests::flow_test_setup::FlowTestSetup;
use starknet_integration_tests::utils::{
Expand Down Expand Up @@ -89,7 +89,7 @@ async fn listen_to_broadcasted_messages(
height: expected_height,
round: 0,
valid_round: None,
proposer: ContractAddress::default(),
proposer: ValidatorId::from(1991_u32),
};
let expected_proposal_fin = ProposalFin { proposal_content_id: BlockHash(expected_content_id) };

Expand Down

0 comments on commit a474d6e

Please sign in to comment.