Repository navigation
fix(sdk-coin-flrp): gas-aware import fee bound and wallet-threshold binding - #10217
Draft
prithvishet2503 wants to merge 1 commit into
Draft
prithvishet2503 wants to merge 1 commit into
prithvishet2503 wants to merge 1 commit into
Conversation
…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
Contributor
Contributor
|
|
This branch has not been deployed
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.
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