Conversation
Pin paykit-lib and paykit-sdk to the merge commit of the pubky/paykit-rs Allowances stack (#158 to #161, 6561359) and port the Payment Request terms to its validated builder and accessors. The new StorageState starts with allowance_accounting. The server decodes the rows it wrote with rc48 as version 1 (rc48 and rc55 share that layout) and keeps writing version 1 while accounting is empty, so the rc48 build can still read them.
During every handoff, after the link is ready, the server reads the reader's private messages on that link and accepts each Allowance proposal that names the creator as Allowee, up to four per handoff. The acceptance is queued ahead of the endpoint list and the Payment Request, so the reader's wallet can pay the request under the Allowance without a swipe. Intake is best effort: a failure is logged (stage=allowance_intake) and the request is still proposed. Only the server holds the creator's Noise key for its receiver path, so an Allowance a reader grants on that link can be answered only here.
ab0e8b1 to
af0151a
Compare
|
Pushed
|
|
Pushed e29edd1: the e2e test no longer fails on redelivered requests. Test-only change in Cause. I traced each handoff stage in the failing runs. The server does send the same Payment Request more than once, but only after a handoff outlived its outbox lease, never inside one:
Fix (test only):
I left the product code alone. Nothing sends a duplicate within the lease, and the intake adds about a second to a handoff that normally finishes in a few seconds against a 30s lease. Counting lock wait inside the lease is a possible follow-up in the outbox, not part of this PR. Runs (PostgreSQL 16 container, machine already under load):
|
|
Pushed
|
Refs:
Summary
A reader who grants a creator an Allowance in Bitkit still had to swipe to pay each Locks unlock. The server never read the reader's messages on the shared Encrypted Link, so an Allowance the reader proposed there stayed unanswered. Only the server's
paykit-serverApp can accept it: the reader names the creator identity as Allowee, and the server runs as that identity's delegated Paykit App.#33 moved the server to the identity-wide shared runtime in Paykit
v0.1.0-rc59and is merged intomaster; this PR builds on it and targetsmaster.Change
stage=allowance_intake) and the request is still proposed for manual payment.SDK
Paykit
v0.1.0-rc59(#33's pin) contains the Allowances stack, pubky/paykit-rs#158 to pubky/paykit-rs#161, so this PR adds no dependency pin of its own. Against the shared runtime in rc59:AllowanceFilterandaccept_allowancetake only the counterparty.app_id, and removing an App does not revoke an accepted Allowance.claim_payment_request_for_execution) before it accepts the request automatically. The e2e wallet does this.Tests
allowances.rsallowance_proposed_on_the_server_link_covers_the_next_locks_invoiceruns the production server, PostgreSQL and a Pubky testnet against a wallet on the shared-state SDK:amount_outside_range);Proposed.paykit.rsonly_received_consistent_allowee_proposals_are_acceptedtests/outbox.rsallowance_intake_runs_on_the_link_before_the_requesttests/outbox.rsfailed_allowance_intake_still_proposes_the_requestmasterincluding Feat/lock payment draining #3's lock payment draining):cargo test --locked -p paykit-server, companion-auth example tests,cargo clippy --locked --workspace --all-targets -- -D warningsandcargo fmt --all --check: passcargo test --locked -p paykit-server-e2e -- --test-threads=1against PostgreSQL 16: full suite pass on head 00c74b4 (one earlier full run failed once inserver_workflow.rsmalformed_recovery_marker_keeps_exact_handoff_retryable_until_repairedunder machine load and passed on 3 reruns and the next full run); the allowance test passed 40 of 40 consecutive runs one29edd1(it failed about 1 run in 8 before; the cause is in the earlier PR comment)