Open scirner22 opened 3 months ago
@scirner22 we have just hit this same issue. Did you find a resolution?
try local state sync commands if you can download the snapshot yourself. simd snapshots --help
I did not find a resolution here. I gave up in favor of the snapshot export/import flow since the snapshot node is local to our infrastructure.
I think we ended up getting it figured out. Essentially, the timeout occurs because CometBFT takes too long to verify the block headers. This can happen in two cases: either when your trusted_height
is too far below the snapshot height, or if your trusted_height
is higher than the latest known snapshot height (in which case it re-verifies all of the headers from genesis).
Essentially:
Take for example a chain where the most recent snapshot height is at 1000000. If If the trusted height is at 1000001, then it will re-verify all headers from genesis, and time out while doing so. If it is set at 500000, it will reverify all headers from there until the snapshot, which also takes too long and times out.
Block 1000001 <- trusted height here forces re-verifications from block 0
Block 1000000 <- most recent snapshot
Block 999999
...
Block 500000 <- trusted height here forces re-verifying too many block headers, causing timeout
...
Block 2
Block 1
Block 0
Once again, I am not 100% sure of this, but some basic testing shows this to probably be along the right lines.
Is there an existing issue for this?
What happened?
Attempting to state sync against a snapshot always produces a
context deadline exceeded
error.available snapshots
state sync attempt logs
Configuration
The error makes it appear like it's trying to fetch a block or block result at a specific height and timing out. I can curl and fetch that block on the order of milliseconds so it's confusing why the light client seems to not be able to do the same. Is there a config that controls the light client timeout?
What's also a bit confusing is that it's trying to fetch a height before the snapshot height. If the state sync is successful, it's earliest height will be the state sync height + 1 so what's the significance of fetching older blocks?
Another point of confusion is why the snapshot height requested (and available on the snapshot node) is not a height matched on the Discovered new snapshot lines?
Cosmos SDK Version
v0.50.7
How to reproduce?
No response