Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Query event #350

Merged
merged 16 commits into from
Nov 2, 2023
Merged

Query event #350

merged 16 commits into from
Nov 2, 2023

Conversation

cryptoAtwill
Copy link
Contributor

Query the quorum reached event to trigger processing of checkpoint submission.

@cryptoAtwill cryptoAtwill requested a review from adlrocha October 27, 2023 05:53
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to clarify a bit some of the commands. But overall LGTM.


for h in arguments.from_epoch..=arguments.to_epoch {
let bundle = provider.get_bottom_up_bundle(&subnet, h).await?;
println!("{bundle:?}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind making the print a bit prettier like I did for top-down cross-messages? The debug output is quite hard to read: https://github.com/consensus-shipyard/ipc/blob/65e92a324e4c3818ceeee90f1416d10d8ad9a107/ipc/cli/src/commands/crossmsg/topdown_cross.rs#L44

ipc/cli/src/commands/checkpoint/bottomup_height.rs Outdated Show resolved Hide resolved
ipc/cli/src/commands/checkpoint/bottomup_bundles.rs Outdated Show resolved Hide resolved
ipc/cli/src/commands/checkpoint/bottomup_submitted.rs Outdated Show resolved Hide resolved
@@ -74,6 +80,12 @@ pub(crate) struct BottomUpRelayerArgs {
pub subnet: String,
#[arg(long, short, help = "The number of seconds to submit checkpoint")]
pub checkpoint_interval_sec: Option<u64>,
#[arg(
Copy link
Contributor

@adlrocha adlrocha Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can generally be 0 as in Tendermint we don´t expect re-orgs. That being said, this may come handy once we support other types of consensus algorithms in child subnets.

Actually, I think the default here should be zero, no need to wait for any finalization buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it is default to 0 if user does not set it.

ipc/provider/src/manager/subnet.rs Outdated Show resolved Hide resolved
@@ -27,6 +28,8 @@ pub struct BottomUpCheckpointManager<T> {
metadata: CheckpointConfig,
parent_handler: T,
child_handler: T,
/// The number of blocks away from the chain head that is considered final
finalization_blocks: ChainEpoch,
Copy link
Contributor

@adlrocha adlrocha Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As described above, I don't think we need this parameter (at least for Tendermint). We can leave it here, but let's leave the default as 0

@@ -151,21 +169,41 @@ impl<T: BottomUpCheckpointRelayer + Send + Sync + 'static> BottomUpCheckpointMan
async fn submit_next_epoch(&self, submitter: &Address) -> Result<()> {
let next_submission_height = self.next_submission_height().await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a sanity-check: remember that relayers are allowed to submit a checkpoint for height h even if it has been submitted already as long as no submission have been made yet for h+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, there is a submit last method

@cryptoAtwill cryptoAtwill merged commit 203afed into dev Nov 2, 2023
3 checks passed
@cryptoAtwill cryptoAtwill deleted the query-event branch November 2, 2023 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants