Fix: fix topAdmins function to use KMS wallet signing#518
Open
Fix: fix topAdmins function to use KMS wallet signing#518
Conversation
… enhance logging for KMS configuration
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The previous
txManager.lockaroundtopAdminshas been removed; if multiple workers can still call this concurrently, consider whether you still need some form of nonce/concurrency control to avoid conflicting transactions. - In
topAdmins,sendTransactionis now called with an empty options object; if gas/fee overrides are needed in some environments, consider explicitly documenting or wiring them through rather than relying solely onsendTransactiondefaults. - The
console.log('Test chainId', chainId)inWeb3Walletlooks like temporary debug output; consider switching this to the existing logger or removing it before merging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The previous `txManager.lock` around `topAdmins` has been removed; if multiple workers can still call this concurrently, consider whether you still need some form of nonce/concurrency control to avoid conflicting transactions.
- In `topAdmins`, `sendTransaction` is now called with an empty options object; if gas/fee overrides are needed in some environments, consider explicitly documenting or wiring them through rather than relying solely on `sendTransaction` defaults.
- The `console.log('Test chainId', chainId)` in `Web3Wallet` looks like temporary debug output; consider switching this to the existing logger or removing it before merging.
## Individual Comments
### Comment 1
<location path="src/server/blockchain/Web3Wallet.js" line_range="509-512" />
<code_context>
- } catch (e) {
- log.error('topAdmins failed', e)
- fail()
+ log.debug('topAdmins:', { numAdmins, addresses: this.addresses })
+ for (let i = 0; i < numAdmins; i += 50) {
+ log.debug('topAdmins sending tx', { adminIdx: i })
+ await this.sendTransaction(this.proxyContract.methods.topAdmins(i, i + 50), {}, undefined, true, log)
+ log.debug('topAdmins success', { adminIdx: i })
}
</code_context>
<issue_to_address>
**issue (bug_risk):** Dropping the explicit txManager lock may reintroduce nonce/race issues if topAdmins is invoked concurrently.
Previously this path locked on `this.addresses[0]` and reused a single `nonce` for all batched `topAdmins` calls. Now we depend on `sendTransaction` for nonce handling and no longer serialize via `txManager.lock`. If `topAdmins` can run concurrently across workers/processes, this could lead to nonce collisions or reordered transactions unless `sendTransaction` applies equivalent cross-caller locking. Consider either wrapping this loop in `txManager.lock` or confirming that `sendTransaction` already enforces a global nonce lock for this wallet.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
sirpy
requested changes
Mar 1, 2026
Contributor
sirpy
left a comment
There was a problem hiding this comment.
This is not the change i've requested.
Go back to our chat.
…ional 'from' address parameter and improve transaction locking logic
f245a94 to
da5b049
Compare
Collaborator
Author
|
I updated sendTransaction to accept a from address. If it’s defined, the txManager locks that address. |
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.
… enhance logging for KMS configuration
Description
make topAdmins function to use sendTransaction which supports KMS signing
About # (link your issue here)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist:
Summary by Sourcery
Update blockchain admin wallet handling to support KMS-based transaction signing and improve EIP-1559 chain handling and logging.
Bug Fixes:
Enhancements: