You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The selection of a positioning ATX involves two steps:
finding a high-tick ATX
verifying PoSTs in the chain of a candidate
The first step was significantly speeded up in #5952. The second step could also take significant time because of two reasons:
It fetches the dependencies (positioning and previous ATXs) back to the genesis (or a "valid" ATX if it was previously fully validated) from the DB, which is usually very loaded at the time ("the atx storm")
It verifies the PoST of every dependency. The post-verifying workers are also very loaded at that time
Actual Behavior
Verification takes very long and, in some cases, finishes after the CG ended (and the poet round started). The miner fails to submit the poet challenge in time.
Expected Behavior
The selection should be guaranteed to always end on time. As a fallback, it's always valid to pick a golden ATX or the previously selected positioning ATX (in the last epoch - that could be picked up from the previous ATX).
logger.Info("search failed - using golden atx as positioning atx", zap.Error(err))
id=b.conf.GoldenATXID
}
b.posAtxFinder.found=&struct {
id types.ATXID
forPublish types.EpochID
}{id, publish}
returnid, nil
}
Implementation hints
The searchPositioningAtx() function should pass a context with a deadline that leaves enough time to register in poet, for example, 5 minutes for mainnet, possibly configurable to let the users tweak it. The deadline should be shorter for tests, systests, and testnets. If the deadline is exhausted, it should fall back to the miner's previous ATX or the golden ATX if this is the initial ATX.
Additionally, post-verification workers could prioritize verifying the PoSTs of the candidate's dependencies. This could be achieved by changing the Post() and PostV2() methods of Validator to allow prioritized verification. The existing Post verifier already supports prioritization but it would need to be extended to allow prioritizing the current call, instead of just by node IDs. See
Description
The selection of a positioning ATX involves two steps:
The first step was significantly speeded up in #5952. The second step could also take significant time because of two reasons:
Actual Behavior
Verification takes very long and, in some cases, finishes after the CG ended (and the poet round started). The miner fails to submit the poet challenge in time.
Expected Behavior
The selection should be guaranteed to always end on time. As a fallback, it's always valid to pick a golden ATX or the previously selected positioning ATX (in the last epoch - that could be picked up from the previous ATX).
Additional Resources
Related code:
go-spacemesh/activation/activation.go
Lines 823 to 864 in 7b09993
Implementation hints
The
searchPositioningAtx()
function should pass a context with a deadline that leaves enough time to register in poet, for example, 5 minutes for mainnet, possibly configurable to let the users tweak it. The deadline should be shorter for tests, systests, and testnets. If the deadline is exhausted, it should fall back to the miner's previous ATX or the golden ATX if this is the initial ATX.Additionally, post-verification workers could prioritize verifying the PoSTs of the candidate's dependencies. This could be achieved by changing the
Post()
andPostV2()
methods ofValidator
to allow prioritized verification. The existing Post verifier already supports prioritization but it would need to be extended to allow prioritizing the current call, instead of just by node IDs. Seego-spacemesh/activation/post_verifier.go
Lines 299 to 324 in 7b09993
The text was updated successfully, but these errors were encountered: