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

Shared sequencer: fetch and use latest block height #2464

Closed
Dentosal opened this issue Nov 29, 2024 · 2 comments
Closed

Shared sequencer: fetch and use latest block height #2464

Dentosal opened this issue Nov 29, 2024 · 2 comments

Comments

@Dentosal
Copy link
Member

Update the shared sequencer service to use the following query to find the block height, and post blobs starting from that height:

curl --request POST   --url https://rpc-seq.simplystaking.xyz/   --header 'Content-Type: application/json'   --data '{"jsonrpc": "2.0","id": 1,"method": "tx_search","params": {"query": "message.action='\''/fuelsequencer.sequencing.v1.MsgPostBlob'\'' AND message.sender='\''fuelsequencer14t0nvrj4v3at8f4fzywfn0qrsu4532ns7n4ywv'\''","prove": true, "order_by": "desc", "page": "1", "per_page": "1"}}'

During the initialization of the service, we need to know what is the latest SS block height where we posted blobs.
If we know it, we can request all blobs from this SS block, parse them, and find the latest posted information which contains the height of the Fuel block.
After we know the latest Fuel height was submitted, we can start submitting new blocks.

@MitchTurner
Copy link
Member

@Dentosal is this still needed?

We can see where the code posts the blobs:

pub async fn send<S: Signer>(
&self,
signer: &S,
account: AccountMetadata,
order: u64,
blob: Vec<u8>,
) -> anyhow::Result<()> {
let latest_height = self.latest_block_height().await?;
self.send_raw(
// We don't want our transactions to be stay in the mempool for a long time,
// so we set the timeout height to be 64 blocks ahead of the latest block height.
// The 64 is an arbitrary number.
latest_height.saturating_add(64),
signer,
account,
order,
self.topic,
Bytes::from(blob),
)
.await
}

But are we querying for the block height anywhere?

@Dentosal
Copy link
Member Author

Dentosal commented Feb 6, 2025

Yep already done

@Dentosal Dentosal closed this as completed Feb 6, 2025
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

No branches or pull requests

2 participants