fix(nonce): Koios fallback for η_ph in TICKN computation#80
Conversation
TICKN computation for next epoch nonce failed because historical sync has block gaps (epochs 284-612 missing due to keep-alive timeouts). Added Koios blocks API fallback in GetLastBlockHashForEpoch path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe changes modify Changes
Sequence DiagramsequenceDiagram
participant Client
participant GetNonceForEpoch
participant LocalDB
participant Koios
Client->>GetNonceForEpoch: GetNonceForEpoch(fullMode, candidateNonce exists)
GetNonceForEpoch->>LocalDB: Query previous epoch's last block hash
alt Local DB has data
LocalDB-->>GetNonceForEpoch: Return block hash
GetNonceForEpoch-->>Client: Compute & return nonce
else Local DB empty or error
LocalDB-->>GetNonceForEpoch: Empty/Error
GetNonceForEpoch->>Koios: fetchLastBlockHashFromKoios(epoch)
Koios-->>GetNonceForEpoch: Return hex hash
GetNonceForEpoch-->>Client: Compute & return nonce
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix(nonce): Koios fallback for η_ph in TICKN computation
fix(nonce): Koios fallback for η_ph in TICKN computation
Summary
fetchLastBlockHashFromKoios()fallback when DB doesn't have blocks for the required epochTest plan
go vetclean🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes