Regenerate GameState declarations for notifyMainerTopUp and guard official_topup against the new minimum - #204
Open
icppWorld wants to merge 2 commits into
Open
Regenerate GameState declarations for notifyMainerTopUp and guard official_topup against the new minimum#204icppWorld wants to merge 2 commits into
icppWorld wants to merge 2 commits into
Conversation
…icial_topup against the new minimum
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.
Why
Companion to onicai/PoAIW#163, which adds
notifyMainerTopUpto GameState. Merge that one first — this PR only carries what lives in this repo.What
Regenerated GameState declarations (
dfx generate game_state_canister). The interface diff is three added service lines and zero new type definitions:notifyMainerTopUpandresolveMainerByPrefixAdmin— from PoAIW#163isCallerMainerOwnedBy— not from this work. It was added to GameState in PoAIW50109b4(the remove mAIner owners as canister controllers change), but the declarations in this repo were never regenerated at the time, so they sat one method behind until now. Nothing consumed it — no caller exists in the frontend or scripts — which is why the gap was invisible. Additive and harmless; runningdfx generatein CI would keep the two repos in step automatically.scripts/official_topup.py— guarded against the new protocol minimum. GameState now rejects unauthenticated top-ups below 0.09 ICP, and this script pays first and redeems second, so an undersized payment would strand ICP as a paid-but-unredeemable block — landing in the script's own "PAID but redeem FAILED" branch.ICP_GRANULARITY0.05 → 0.1. It is also the smallest auto-sized payment (icp_needed_forfloors at it), so at 0.05 a small shortfall would have sized a payment the protocol then refuses.e8s < 9_000_000, naming the minimum, so a manual--icpbelow it fails before any funds move.This matters most in exactly the situation the script exists for: rescuing a mAIner whose upgrade failed, where the direct
deposit_cyclesroute burns 90% of the top-up.Verification
The declarations were regenerated and diffed; the interface change is purely additive. The script changes are covered by the end-to-end suite in PoAIW#163, which drives
pay_topup.pyagainst a local replica with a real ICP ledger.Nothing here was run against a mainnet network.