Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sequencing): remove ProposalChunk #2512

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading