-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[BWS] Set latest nonce on publish for EVM proposals #3971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v10
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me. If I publish a txp with a nonce of 8 and then it gets "refreshed" to something else, it'll fail the server verification when trying to sign it.
This approach makes me a little nervous since it'll apply to all EVM txps and can cause confusion if we compromise the integrity of txp.nonce (i.e. it's set to X initially, but later gets updated to Y). I would recommend we take a different approach that's BWC-driven. Say, let's allow nonce to be null or -1 to indicate that it should be assigned later (e.g. on signature). IIRC, null falls back to 0 when creating signatures, so that would probably require the least change with intermediate signing/verifying. We'll just need to ensure txp.nonce doesn't get set to 0 if nonce == null until it's time to actually assign the nonce.
return cb(null, txp); | ||
refreshTxData(server: WalletService, txp, opts, cb) { | ||
// set latest nonce | ||
server._getTransactionCount(opts.wallet, txp.from, (err, nonce) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint: extra space before txp.from
No description provided.