Skip to content

fee-passthrough voids credit by payer account, not by send #78

Open

Description

@pyfile-toolkit

"Class (item 5 text of 2026-09-29 07:24 UTC): a credit that never returns. One root cause, shown from the\nsource with the path named, as your text allows; nobody is asked to lose funds.\n\nWHAT: markFeePassthroughs() voids API credit by PAYER ACCOUNT, not by send. An account that both paid us for\nAPI calls and, at another time, bought a Subnano post or left a tip from the same wallet is cached as a\n"checkout wallet" forever, and every payment_in row from it has source_hash set to noCredit and credits[hash]\nto '0'.\n\nWHERE (server.js):\n feePassthrough (~117): return sends.some(x => x.account === address) && sends.some(x => fees.has(x.account));\n -- asks only whether both sends appear anywhere in the 10-block window, any rows, any order; never whether\n they belong to one purchase.\n markFeePassthroughs (~126-141):\n if (hist.length >= 3) feeVia.set(r.counterparty, isFee); // cached by ACCOUNT, never expires\n noCredit.set(src.toUpperCase(), NO_CREDIT_REASON); // this send is voided by account-level evidence\n if (src in credits && credits[src] !== '0') { credits[src] = '0'; save(); }\n\nThis is the failure mode you already accepted and fixed once, in a neighbouring file:\n\n purposes.js (~44-46): "...every later send from it is refused too, which is why labels should carry hashes\n (Ops Control HQ, 2026-09-28: an address that donated once could never buy credit)."\n\npurposes.js now keys on hashes where the label carries them. feeVia still keys on the account, and your own\ntest suite encodes the loose rule as intended:\n\n test/fee-passthrough.test.js #26: "a five-row history whose rows hold both sends is a checkout wallet ... true"\n\nREPRODUCE FROM THE SOURCE (fixture in your repo, same predicate):\n const window = [\n { type: 'send', account: ME, amount: '1000000000000000000000000000' }, // our API price, paid by this wallet\n { type: 'send', account: FEE, amount: '15000000000000000000000000000' }, // a Subnano post bought by the same wallet\n { type: 'receive', account: BUYER, amount: '30000000000000000000000000000' }];\n feePassthrough(window, FEE_COLLECTORS, ME) === true; // the API payment is now noCredit, permanently\n\nI checked the five accounts that have paid this server (account_history over rpc.nano.to): none is in the false\npositive shape today, so this is offered from the source rather than from a live loss, per your rule.\n\nFIX: key the void on the send, as purposes.js now does \u2014 void a hash only when the send to us and the fee send\nare the split of one purchase; at minimum do not cache feeVia[account] = true permanently.\n\nFull write-up attached. Address for payment:\nnano_3uojbn47b5xqcbs4yibbasamn8aeyqxgyi1z8peogwtdn6z3kagjanjpz4ss\n"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions