Skip to content

fix(sdk-coin-flrp): gas-aware import fee bound and wallet-threshold binding - #10217

Draft
prithvishet2503 wants to merge 1 commit into
masterfrom
prithvishet/cecho-2717-bitgojs-flrpverifytransaction-import
Draft

prithvishet2503 wants to merge 1 commit into
masterfrom
prithvishet/cecho-2717-bitgojs-flrpverifytransaction-import

Conversation

@prithvishet2503

Copy link
Copy Markdown
Contributor

Two review follow-ups for the CECHO-2717 import verification hardening:

  • validateImportFee capped every import at the flat statics maxImportFee (10,000,000 nFLR), rejecting correctly built large imports: flarejs charges per serialized byte and per signature slot, so 400 one-signature inputs at the 25 nFLR/gas fixture base fee legitimately burn >= 11,070,000 nFLR. The bound is now gas-aware: the burned fee must stay under max(maxImportFee, gasCost x 1000 nFLR/gas), where gasCost mirrors flarejs's own import gas model (bytes + 1000 gas per signature + 10000 base gas) computed from the parsed transaction under verification. Protection against excessive fees is retained: a prebuild burning above its own gas cost at the ceiling rate still fails.

  • validateImportOutputPolicy only checked the output threshold's range, so a prebuild weakening the spend policy over the wallet's own addresses (e.g. a 1-of-3 output for a 2-of-3 wallet) passed verification. The output threshold must now equal the wallet record's spend threshold - the same independently established value wallet-platform passes to the import builder - and a missing wallet threshold fails closed.

Ticket: CECHO-2717

https://github.com/BitGo/bitgo-microservices/pull/64720

…inding

Two review follow-ups for the CECHO-2717 import verification hardening:

- validateImportFee capped every import at the flat statics maxImportFee
  (10,000,000 nFLR), rejecting correctly built large imports: flarejs charges
  per serialized byte and per signature slot, so 400 one-signature inputs at
  the 25 nFLR/gas fixture base fee legitimately burn >= 11,070,000 nFLR. The
  bound is now gas-aware: the burned fee must stay under
  max(maxImportFee, gasCost x 1000 nFLR/gas), where gasCost mirrors flarejs's
  own import gas model (bytes + 1000 gas per signature + 10000 base gas)
  computed from the parsed transaction under verification. Protection
  against excessive fees is retained: a prebuild burning above its own gas
  cost at the ceiling rate still fails.

- validateImportOutputPolicy only checked the output threshold's range, so a
  prebuild weakening the spend policy over the wallet's own addresses (e.g.
  a 1-of-3 output for a 2-of-3 wallet) passed verification. The output
  threshold must now equal the wallet record's spend threshold - the same
  independently established value wallet-platform passes to the import
  builder - and a missing wallet threshold fails closed.

Ticket: CECHO-2717
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

CECHO-2717

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant