Skip to content
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

Get pending nonce #844

Merged
merged 7 commits into from
Oct 25, 2024
Merged

Get pending nonce #844

merged 7 commits into from
Oct 25, 2024

Conversation

mvandeberg
Copy link
Member

Brief description

When submitting a transaction to chain, chain first checks for a pending nonce from the mempool and uses it as the account nonce if it exists. This allows a user to queue sequential nonces prior to earlier transactions being included in blocks.

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

❯ ./run.sh pending_nonce                               
~/dev/koinos-integration-tests/tests/pending_nonce ~/dev/koinos-integration-tests
[+] Running 6/6
 ✔ Network pending_nonce_default          Created                                                                                                                                                                                                     0.1s 
 ✔ Container pending_nonce-amqp-1         Started                                                                                                                                                                                                     0.2s 
 ✔ Container pending_nonce-chain-1        Started                                                                                                                                                                                                     0.3s 
 ✔ Container pending_nonce-block_store-1  Started                                                                                                                                                                                                     0.5s 
 ✔ Container pending_nonce-jsonrpc-1      Started                                                                                                                                                                                                     0.5s 
 ✔ Container pending_nonce-mempool-1      Started                                                                                                                                                                                                     0.5s 
=== RUN   TestPublishTransaction
    integration.go:699: Waiting 1s for chain to be ready...
    integration.go:699: Waiting 2s for chain to be ready...
    integration.go:699: Waiting 4s for chain to be ready...
--- PASS: TestPublishTransaction (7.04s)
PASS
ok      koinos-integration-tests/tests/pending_nonce    7.056s
[+] Running 6/6
 ✔ Container pending_nonce-jsonrpc-1      Removed                                                                                                                                                                                                     0.2s 
 ✔ Container pending_nonce-mempool-1      Removed                                                                                                                                                                                                     0.3s 
 ✔ Container pending_nonce-block_store-1  Removed                                                                                                                                                                                                     0.1s 
 ✔ Container pending_nonce-chain-1        Removed                                                                                                                                                                                                     0.3s 
 ✔ Container pending_nonce-amqp-1         Removed                                                                                                                                                                                                     1.2s 
 ✔ Network pending_nonce_default          Removed                                                                                                                                                                                                     0.2s 
~/dev/koinos-integration-tests

@mvandeberg mvandeberg marked this pull request as ready for review October 25, 2024 13:49
@mvandeberg mvandeberg requested a review from sgerbino October 25, 2024 13:49
@mvandeberg mvandeberg merged commit c86d6f7 into master Oct 25, 2024
2 checks passed
@mvandeberg mvandeberg deleted the get-pending-nonce branch October 25, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants