-
Notifications
You must be signed in to change notification settings - Fork 341
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
fix(gnofaucet): fix transactions by querying account number and sequence each time #1493
fix(gnofaucet): fix transactions by querying account number and sequence each time #1493
Conversation
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1493 +/- ##
==========================================
+ Coverage 55.85% 56.11% +0.26%
==========================================
Files 431 432 +1
Lines 65729 65971 +242
==========================================
+ Hits 36713 37022 +309
+ Misses 26140 26058 -82
- Partials 2876 2891 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
We are now using the new faucet at https://github.com/gnolang/faucet which doesn't have this problem. So this PR to fix the old gnofaucet would be reviewed with low priority (or never). Should I close this PR now? |
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.
Confirming this is broken in the deprecated faucet implementation (in this repo), it's something we've fixed in the new faucet
Thank you for the fix 🙏
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.
Approving and merging. Even though it's a fix for a deprecated component, it still improves our codebase's situation, and this PR is better merged than closed :)
Thanks!
…nce each time (gnolang#1493) Currently, `gnofaucet` [queries the blockchain once](https://github.com/gnolang/gno/blob/c3a4993335f8881989eb49e4efea6a3c1310061d/gno.land/cmd/gnofaucet/serve.go#L191-L209) for the account number and sequence number, and [increments the sequence number](https://github.com/gnolang/gno/blob/master/gno.land/cmd/gnofaucet/serve.go#L327) each time that it sends coins. We are using `gnofaucet` with `gnodev`. When `gnodev` restarts the chain, it also resets the sequence number. This means that we also have to restart `gnofaucet` (to re-query the sequence number), which is inconvenient for the development workflow. If you agree that it would be nice for `gnofaucet` to continue to work after `gnodev` does a reset, then this pull request moves the query for the account number and sequence number into the `sendAmountTo` function so that it queries each time it signs a transaction. Now `gnofaucet` continues to function even if the sequence number is unexpectedly changed (because the blockchain is reset or because some other transaction is signed with the same key). Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Currently,
gnofaucet
queries the blockchain once for the account number and sequence number, and increments the sequence number each time that it sends coins. We are usinggnofaucet
withgnodev
. Whengnodev
restarts the chain, it also resets the sequence number. This means that we also have to restartgnofaucet
(to re-query the sequence number), which is inconvenient for the development workflow.If you agree that it would be nice for
gnofaucet
to continue to work aftergnodev
does a reset, then this pull request moves the query for the account number and sequence number into thesendAmountTo
function so that it queries each time it signs a transaction. Nowgnofaucet
continues to function even if the sequence number is unexpectedly changed (because the blockchain is reset or because some other transaction is signed with the same key).