feat(kora-deploy): add resume capability and buffer cleanup on transient failures - #614
feat(kora-deploy): add resume capability and buffer cleanup on transient failures#614raushan728 wants to merge 10 commits into
Conversation
Greptile SummaryThis PR adds resume capability and automatic buffer cleanup to
Confidence Score: 5/5
Important Files Changed
Reviews (29): Last reviewed commit: "fix(deploy): update devnet-deploy-paymas..." | Re-trigger Greptile |
f7f20bc to
409473b
Compare
de0ed37 to
946793a
Compare
6ef22fe to
affdf0f
Compare
affdf0f to
4205050
Compare
4205050 to
4c2465b
Compare
04f8086 to
ccc6d96
Compare
ccc6d96 to
be3fdc6
Compare
0562074 to
83dc669
Compare
dev-jodee
left a comment
There was a problem hiding this comment.
- should .gitignore
.kora-deploy-state.json - should prob have tests for hash-mismatch detection, written_chunks > chunk_count corruption handling, skip-already-written-chunks, is_already_live short-circuit, etc.
ff0dad3 to
87743c2
Compare
Added
Added pure-logic unit tests for the two state-invariant checks For the remaining cases you mentioned (skip-already-written-chunks, is_already_live short-circuit) agreed these need coverage too, but they're integration-style paths that depend on RPC/network calls (Kora + Solana RPC), which this crate doesn't currently have mocking infra for. Rather than bolting on ad-hoc mocks in an already-large PR, we can file a follow-up issue to properly set up mock-based integration testing for kora-deploy. I'll scope that issue to cover both the integration tests AND adding a Windows CI target, since the non-Unix file-permission gap (raised above) would benefit from actually being exercised in CI rather than just reviewed by eye. That way both gaps get closed together with proper CI coverage backing them, instead of being two separate half-measures. |
|
Addresses in 87743c2 |
dev-jodee
left a comment
There was a problem hiding this comment.
all looks good except the 1 nit
|
@raushan728 some CI failures |
…r cleanup Add local state persistence (.kora-deploy-state.json) so deployments can resume after transient RPC failures. Resume is guarded by SHA-256 binary hash verification and chunk bounds checking, with the hash check evaluated first so a rebuilt binary always surfaces a clear hash-mismatch error. On unrecoverable failure, a cleanup macro closes the orphaned on-chain buffer to reclaim rent. Query ProgramData before the final transaction to detect if a prior attempt already succeeded, avoiding a timeout deadlock. Add --resume and --no-cleanup-on-failure CLI flags.
Add --resume and --no-cleanup-on-failure to the flags table. Explain the .kora-deploy-state.json lifecycle: normal resume, hash mismatch handling, and manual recovery for the deploy-timeout edge case.
…and harden deploy state
…ize cleanup_buffer!
…ss check on fresh deploys
Use share_mode(0) for Windows state file creation to prevent concurrent access.Add .kora-deploy-state.json to .gitignore Extract check_state_invariants from validate_state and add unit tests
e400dd7 to
eb5cc90
Compare
Fixed in eb5cc90 |
Adds resume capability and automatic buffer cleanup to kora-deploy, persisting local state so deployments can recover from transient failures instead of leaving orphaned on-chain buffers.
--resume, guarded by SHA-256 hash verification and chunk bounds checking--no-cleanup-on-failureto leave the buffer open for a later--resume.kora-deploy-state.jsonto.gitignoresince it contains raw keypair bytesshare_mode(0)on the non-Unix save path as a partial mitigation (concurrency guard only, not an ACL restriction full Windows permission support is out of scope here)check_state_invariants()helper