Skip to content

Update subxt #864

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Update subxt #864

wants to merge 13 commits into from

Conversation

AndreiEres
Copy link
Collaborator

No description provided.

@AndreiEres AndreiEres force-pushed the AndreiEres/update-subxt branch from a454e36 to 46e83d4 Compare May 27, 2025 11:19

let head = subxt.get_block_head(rpc_node_url(), None).await.unwrap().unwrap();
let cores = subxt.get_occupied_cores(rpc_node_url(), head.hash()).await;
let cores = subxt.get_occupied_cores(rpc_node_url(), hasher.hash_of(&head)).await;
Copy link

Choose a reason for hiding this comment

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

I wonder whether you can avoid needing to expose the hasher for many of these calls by doing one of the following:

  1. Have a function like get_block_hash rather (or as well as) get_block_head. In Subxt, blocks have a .hash() method for instance that could return this.
  2. Have functions accept a block header rather than a block hash (so that the hashing can be handled "internally" by Subxt). Perhaps this is difficult because it looks like you pass things through a channel, so would need owned values and headers are larger than hashes to have to be sending etc.
  3. Functions could also accept something like a trait IntoBlockHash { fn hash() } type trait and then we have impls for hashes but also blocks or whatever. Maybe suffers from the same issue as 2 does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants