Skip to content

Commit

Permalink
chore(sequencing): remove ProposalChunk
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-starkware committed Dec 10, 2024
1 parent f630f48 commit 307e662
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions crates/sequencing/papyrus_consensus/src/manager_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use papyrus_protobuf::consensus::{
};
use papyrus_test_utils::{get_rng, GetTestInstance};
use starknet_api::block::{BlockHash, BlockNumber};
use starknet_api::transaction::Transaction;
use starknet_types_core::felt::Felt;

use super::{run_consensus, MultiHeightManager};
Expand Down Expand Up @@ -52,7 +51,6 @@ mock! {

#[async_trait]
impl ConsensusContext for TestContext {
type ProposalChunk = Transaction;
type ProposalPart = ProposalPart;

async fn build_proposal(
Expand Down
1 change: 0 additions & 1 deletion crates/sequencing/papyrus_consensus/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ mock! {

#[async_trait]
impl ConsensusContext for TestContext {
type ProposalChunk = u32;
type ProposalPart = MockProposalPart;

async fn build_proposal(
Expand Down
6 changes: 2 additions & 4 deletions crates/sequencing/papyrus_consensus/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ pub const DEFAULT_VALIDATOR_ID: u64 = 100;
/// Interface for consensus to call out to the node.
#[async_trait]
pub trait ConsensusContext {
/// The chunks of content returned when iterating the proposal.
// In practice I expect this to match the type sent to the network
// (papyrus_protobuf::ConsensusMessage), and not to be specific to just the block's content.
type ProposalChunk; // TODO(guyn): deprecate this (and replace by ProposalPart)
/// The parts of the proposal that are streamed in.
/// Must contain at least the ProposalInit and ProposalFin.
type ProposalPart: TryFrom<Vec<u8>, Error = ProtobufConversionError>
+ Into<Vec<u8>>
+ TryInto<ProposalInit, Error = ProtobufConversionError>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ impl PapyrusConsensusContext {

#[async_trait]
impl ConsensusContext for PapyrusConsensusContext {
type ProposalChunk = Transaction;
type ProposalPart = ProposalPart;

async fn build_proposal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ use starknet_api::block::{
NonzeroGasPrice,
};
use starknet_api::executable_transaction::Transaction as ExecutableTransaction;
use starknet_api::transaction::Transaction;
use starknet_batcher_types::batcher_types::{
DecisionReachedInput,
GetProposalContent,
Expand Down Expand Up @@ -134,8 +133,6 @@ impl SequencerConsensusContext {

#[async_trait]
impl ConsensusContext for SequencerConsensusContext {
// TODO(guyn): Switch to ProposalPart when done with the streaming integration.
type ProposalChunk = Vec<Transaction>;
type ProposalPart = ProposalPart;

async fn build_proposal(
Expand Down

0 comments on commit 307e662

Please sign in to comment.