Repository navigation
control-plane, chain/arkiv, frontend: exact seeds on Arkiv, panel shows only the latest draw - #79
Merged
Conversation
…decar accepts keys without 0x Found by running the full loop on the live site for the first time: - Seeds landed on Rabdi rounded: 1065256257932064655 (Postgres) became 1065256257932064640 on chain, because the Node sidecar's JSON.parse rounds integers past 2^53. That breaks replaying the draw from the Arkiv copy. decision_id, seed and budget_micros now go to the sidecar as decimal strings, and the sidecar refuses a u64 that arrives as a JSON number. - The panel compared every draw on a plan with the picks on screen, so each older explore draw showed "does not match the picks above", which reads as tampering. It now shows only the newest draw (one draw's rows share one Postgres transaction, so one decided_at), in task order, counts the rest, and only checks matches when that draw's seed is the one on screen. - The first live deploy crash-looped because MetaMask exports private keys without 0x. The sidecar now accepts either form and names the problem when the key is invalid. Verified: the sidecar against the real Rabdi RPC (no-0x key starts; numeric seed refused; string seed reaches gas estimation); 557 + 450 control-plane tests, ruff/pyright; 510 vitest, tsc, eslint, prettier, build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found by running the full Arkiv loop on the live site for the first time (draft plan, explore, write, read back), and checking the Rabdi chain directly.
1065256257932064655; Rabdi has1065256257932064640. The Node sidecar'sJSON.parserounds integers past 2^53, so the Arkiv copy could not replay the draw.decision_id,seedandbudget_microsnow go to the sidecar as decimal strings, and the sidecar refuses a u64 that arrives as a JSON number rather than store a wrong one.decided_at), in task order, counts the earlier ones, and checks matches only when that draw's seed is the one on screen (otherwise it says the new draw has not landed yet).0x. MetaMask exports private keys without the prefix. The sidecar now accepts either form and names the problem when the key is invalid.Verified
0x5279…20Ab(gas paid, 10.0 → 9.9993 tGLM), read back by the panel with explorer links; this is where the seed mismatch was measured.0xstarts; a numeric seed is refused (its own error shows the rounding); a string seed reaches gas estimation (throwaway unfunded wallet).uv run pytest -q557 passed;-m postgres450 passed; ruff, ruff format, pyright clean.arkivDraw.test.ts), tsc, eslint, prettier, build clean.e2e/live/run.spec.ts: 20/21 locally. The one failure ("an inconclusive task with no agent left…") fails the same way on cleanmainlocally and passes in CI, so it is local-environment only and unrelated to this change.After merge
The 9 entities already on Rabdi keep their rounded seeds (entities cannot be edited; they expire in 30 days). One fresh explore call after deploy should show the exact seed on chain.