Skip to content

Sleep or retry in script to work around optimistic finality in localnet script #2316

@anodar

Description

@anodar

Background

As I run launch-localnet.sh script I get error "FAILED: near account view-account-summary mpc-contract.test.near network-config mpc-localnet now" unless I put sleep before it.

From Ricky:

So this looks like a finality mismatch in near-cli-rs. The send path uses broadcast_tx_commit which returns with optimistic finality, but view-account-summary ... now queries at Finality::Final which lags a couple blocks behind. There's no CLI flag to query at optimistic finality either, so a sleep or retry in the script is probably the best short-term fix.

More background in: https://nearone.slack.com/archives/C07UW93JVQ8/p1772634083567219

User Story

No response

Acceptance Criteria

launch-localnet.sh should work without errors, either by adding sleep or retries.

Resources & Additional Notes

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions