-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat(starknet_consensus_orchestrator): use InternalConsensusTransacti… #3821
feat(starknet_consensus_orchestrator): use InternalConsensusTransacti… #3821
Conversation
…3806) * feat(starknet_os): add hints from moonsong's mod.rs * feat(starknet_os): update the exit_syscall hints to the single hint
Co-authored-by: Gilad Chase <[email protected]>
Artifacts upload workflows: |
0e1431e
to
dc59e43
Compare
cbcd34b
to
a7f5ee5
Compare
This reverts commit 1d9ae96. Co-authored-by: Gilad Chase <[email protected]>
Make scraper track also the last processed block hash, in addition to number. Whenever the scraper is about to start scraping again, check if the last processed block number: 1. Still exists. 2. Fetch it's current block_hash on L1, and compare to the block_hash saved after the last scraping ended. If either of the above checks fail, then this means an L1 reorg has occured, so the infra should crash the provider and initiate the provider/scraper startup flow. Co-authored-by: Gilad Chase <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ShahakShama)
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 156 at r2 (raw file):
pub fn new( config: ContextConfig, class_manager_client: SharedClassManagerClient,
Hmm I had thought the plan was to pass in TransactionConverter and make the context generic over that. Instead we are "generic" (Box) over the class manager.
Code quote:
class_manager_client: SharedClassManagerClient,
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 408 at r2 (raw file):
bouncer_weights: central_objects.bouncer_weights, }) .await;
Suggestion:
let transactions= futures::future::join_all(transactions.into_iter().map(|tx| {
self.transaction_converter.convert_internal_consensus_tx_to_executable_tx(tx)
}))
.await
.into_iter().collect::<Result<Vec<_>, _>>()
// TODO(shahak): Do not panic here.
.expect("Failed converting transactions for cende");
self.cende_ambassador
.prepare_blob_for_next_height(BlobParameters {
// TODO(dvir): use the real `BlockInfo` when consensus will save it.
block_info: BlockInfo { block_number: BlockNumber(height), ..Default::default() },
state_diff,
compressed_state_diff: central_objects.compressed_state_diff,
transactions,
execution_infos: central_objects.execution_infos,
bouncer_weights: central_objects.bouncer_weights,
})
.await;
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 811 at r2 (raw file):
// TODO(shahak): Don't panic here. .expect("Failed converting consensus transaction to internal representation"); debug!("Converted transactions to internal representation.");
This pattern keeps repeating, wanna try creating a helper function?
Code quote:
let txs = futures::future::join_all(txs.into_iter().map(|tx| {
transaction_converter.convert_consensus_tx_to_internal_consensus_tx(tx)
}))
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()
// TODO(shahak): Don't panic here.
.expect("Failed converting consensus transaction to internal representation");
debug!("Converted transactions to internal representation.");
#3839) * feat(starknet_class_manager): adding config to class_manager commit-id:5fb70d46 * feat(starknet_sequencer_node): adding class_manager config to node config commit-id:9b946640 * feat(starknet_sequencer_node,starknet_class_manager): adding class_manager to node components commit-id:267190ec * feat(starknet_class_manager): adding skeleton implementaation of the ComponentRequestHandler trait commit-id:6c5e5276
a7f5ee5
to
9a76b23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 8 of 9 files reviewed, 2 unresolved discussions (waiting on @matan-starkware)
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 156 at r2 (raw file):
Previously, matan-starkware wrote…
Hmm I had thought the plan was to pass in TransactionConverter and make the context generic over that. Instead we are "generic" (Box) over the class manager.
Yes. There's a TODO in the test to do that. Added also here
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 811 at r2 (raw file):
Previously, matan-starkware wrote…
This pattern keeps repeating, wanna try creating a helper function?
I think the helper function will be either unreadable (in terms of what it does) or the call to the helper function will be longer than these lines
Co-authored-by: Gilad Chase <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama)
crates/starknet_consensus_orchestrator/src/sequencer_consensus_context.rs
line 811 at r2 (raw file):
Previously, ShahakShama wrote…
I think the helper function will be either unreadable (in terms of what it does) or the call to the helper function will be longer than these lines
It wasn't so bad:
Callsite:
let transactions = convert_all(
|tx| self.transaction_converter.convert_internal_consensus_tx_to_executable_tx(tx),
transactions,
)
.await;
Definition - generic so can handle any converter:
async fn convert_all<FromT, IntoT, ConverterT, FutT>(
converter: ConverterT,
txs: Vec<FromT>,
) -> Vec<IntoT>
where
ConverterT: Fn(FromT) -> FutT,
FutT: Future<Output = TransactionConverterResult<IntoT>>,
{
futures::future::join_all(txs.into_iter().map(|tx| { converter(tx) }))
.await
.into_iter().collect::<Result<Vec<_>, _>>()
// TODO(shahak): Do not panic here.
.expect("Failed converting transactions for cende")
}
Not blocking just consider it.
rename GetProposalContent to GetProposalContentDeprecated rename SendProposalContent to SendProposalContentDeprecated block builder convert internal to exe tx using class manager
9a76b23
to
def9b3a
Compare
…on in consensus