Conversation
Operator side of the airdrop. `pull` turns the claim server's unpaid recorded claims into a manifest (one transfer per payout account), `review` re-checks it against the server and the chain and approves it, `pay` submits it as a single utility.batch_all from a hot or cold wallet and waits for finalization, and `mark-paid` marks every reward in it paid on the server. The manifest carries the state between steps. A new pull is refused while another manifest in the directory is not yet marked, pay re-verifies the server right before signing and checks the approval hash, and `pay --recover` resolves an interrupted payment by scanning the finalized blocks the batch could have landed in for the exact signer and call bytes. Also default the claim server to https://airdrop-claim.quantus.com, share one JSON GET between /snapshot and /unpaid, and add QuantusClient::get_block_hash in place of the inline chain_getBlockHash calls.
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
Operator side of the airdrop, as four separate
quantus airdropcommands so every step can be checked by hand. A manifest file carries the state between them:pulled → approved → paying → paid → marked.airdrop pull [--out f] [--limit N]GET /unpaid, keepsstatus: recordedrows only, aggregates rewards byclaim_account(one transfer per destination), writes the manifest. Refuses to run while another manifest in the directory is not yetmarked.airdrop review --manifest f [--approve]/unpaidand fails on any reward that was paid, re-claimed or changed since the pull, encodes the batch to report its size against the 8 KiB cold-wallet payload cap.--approvestamps a SHA-256 of the transfers.airdrop pay --manifest f --from wallet [--recover]utility.batch_allthrough the existing submit path (cold wallets go over QR) and waits for finalization. Records signer, nonce, anchor block, then tx and block hash.airdrop mark-paid --manifest f [--admin-token-file p]POST /mark-paidper reward with the bearer token from the file orAIRDROP_ADMIN_TOKEN. Idempotent and re-runnable;409 already marked paidcounts as done.Atomicity and double-pay guards
batch_all: every transfer lands or none does, and a revert surfaces as a command failure through the existingExtrinsicFailedcheck.paying(with signer, nonce and anchor block) before submitting. If the process dies, the manifest cannot be paid again;pay --recoverscans the finalized blocks from the anchor to the mortality horizon for an extrinsic with the same signer and identical call bytes, then either records it as paid, resets toapprovedif it reverted, or resets toapprovedonce the transaction can no longer be included.Also in this PR
DEFAULT_SERVERfor all airdrop commands is nowhttps://airdrop-claim.quantus.com(what the mobile app uses) instead of localhost./snapshotand/unpaidshare one JSON GET helper.QuantusClient::get_block_hashreplaces the inlinechain_getBlockHashcalls inblock.rsandcollect_rewards_lib.rs.Test plan
SKIP_CIRCUIT_BUILD=1 cargo test --lib: 371 passed (7 new unit tests: aggregation, drift detection, approval hash, manifest lock, mark-paid outcome classification, cold payload budget).SKIP_CIRCUIT_BUILD=1 cargo clippy --all-targets --locked -- -D warnings,cargo +nightly fmt.airdrop pullwrote a manifest with 150 transfers covering 286 rewards (5577.96 QUAN); a secondpullin the same directory is refused;airdrop reviewagainstwss://a1-planck.quantus.catpasses the drift check and reports a 6277-byte batch that fits a cold-wallet payload.payandmark-paidend to end against the dev claim server (data/dev_dummy.csv) and a dev node, hot wallet anddeveloper cold-sign-sim.pay --recoverafter killingpaybetween signing and finalization.Not in this PR
Server side: a batch
mark-paidendpoint that takes the address list plus tx hash in one SQLite transaction (and atx_hashcolumn), so step 4 becomes a single call. The per-address loop here works with the server as it is today.