fix: await and reserve bridge service nonces#40
Open
Chillzyg wants to merge 1 commit into
Open
Conversation
|
Maintainer review assist for Bitgesell bounty routing (#81 / #39): this looks like a clean, focused bridge-service correctness fix rather than a broad refactor. Why this PR seems materially useful:
If you are deciding whether to merge/pay this under the improvement program, the key acceptance checks seem to be:
From the public metadata, this PR is currently OPEN + MERGEABLE and had no prior PR comments/reviews visible when checked from my side. |
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
ETH_NONCEenvironment variable while preserving the existingETH__NONCEfallbackWhy
setupNonce()called asyncgetTransactionCount()without awaiting it. On a cold service start,ethNonce/bscNoncecould become a Promise; the later increment path then risked passing an invalid nonce intosendWBGL().Verification
npm install --ignore-scripts --package-lock=falseinservice/npx mocha src/tests/nonce.js --timeout 10000inservice/npx prettier --check src/utils/nonce.js src/utils/config.js src/modules/chores.js src/tests/nonce.jsinservice/node --check src/utils/nonce.js && node --check src/utils/config.js && node --check src/modules/chores.js && node --check src/tests/nonce.jsinservice/npx eslint --parser-options '{"ecmaVersion":2022,"sourceType":"module"}' src/utils/nonce.js src/utils/config.js src/modules/chores.js src/tests/nonce.jsinservice/git diff --checkNote: plain
npx eslint ...fails before analysis in this repo because the current ESLint config does not parse the service's ES-module import/export syntax.Submitted for Bitgesell improvement bounty consideration: BitgesellOfficial/bitgesell#39. Payment details can be provided if accepted.