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

Support top down query #331

Merged
merged 2 commits into from
Oct 6, 2023
Merged

Support top down query #331

merged 2 commits into from
Oct 6, 2023

Conversation

cryptoAtwill
Copy link
Contributor

Add more top down finality util queries in provider.

@cryptoAtwill cryptoAtwill requested a review from adlrocha October 5, 2023 09:17
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.

There seems to be a lot of copy-pasta and things missing (or maybe I am looking at the wrong commit?)

conn.manager().chain_head_height().await
}

pub async fn get_genesis_epoch(&self, subnet: &SubnetID) -> anyhow::Result<ChainEpoch> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a duplicate of the genesis_epoch above?

Some(conn) => conn,
};

conn.manager().chain_head_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.

Also, this doesn't seem what you want to do, right? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, this method should be removed.

};

conn.manager()
.get_validator_changeset(subnet, start, end)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this one implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the evm manager instance.

@@ -128,6 +128,8 @@ pub trait SubnetManager: Send + Sync + TopDownCheckpointQuery {
/// Trait to interact with a subnet to query the necessary information for top down checkpoint.
#[async_trait]
pub trait TopDownCheckpointQuery: Send + Sync {
/// Returns the chain head height
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is wrong, right?

@@ -572,6 +598,25 @@ impl IpcProvider {

conn.manager().get_chain_id().await
}

pub async fn get_chain_head_height(&self, subnet: &SubnetID) -> anyhow::Result<ChainEpoch> {
let conn = match self.connection(subnet) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the change set picked up from the parent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is get chain head height? Anyways, for change set, it's from the subnet actor in parent, so the address should be derived from the subnet directly.

@cryptoAtwill cryptoAtwill merged commit dc011ff into dev Oct 6, 2023
3 checks passed
@cryptoAtwill cryptoAtwill deleted the top-down-query branch October 6, 2023 00:38
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