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

Miner optimization - reduce RPC queries when submitting a transaction #286

Merged
merged 16 commits into from
Sep 9, 2024

Conversation

syntrust
Copy link
Collaborator

@syntrust syntrust commented May 16, 2024

The motivation of this PR is to optimize the process of mining transaction submission, reducing network interactions to save time and reduce the chance of failure caused by bad network condition.

What's in this PR:

  1. Query networkID at the beginning instead of query each time when sending tx, which is not necessary.
  2. Use miningReward of storage contract instead of the implementation in es-node to save more network communications and duplicated code.

Test can be done using a mining test case such as

env ES_NODE_SIGNER_PRIVATE_KEY=<pk> ./integration_tests/run_tests.sh

The result shows the fix reduced the RPC queries by 4 during a mining tx submission.

@syntrust syntrust marked this pull request as ready for review August 26, 2024 04:00
@syntrust syntrust requested review from qzhodl and ping-ke August 26, 2024 04:00
@qzhodl
Copy link
Collaborator

qzhodl commented Aug 28, 2024

  1. Save networkID at beginning
  2. Use miningReward of storage contract instead of es-node.

Reduced the RPC queries by 4 during a mining tx submission.

I think two things should be included in the description of this PR:

  • The motivation of reducing the RPC queries, e.g. the network id
  • The test plan: did you finish the test, and what's the test result

@syntrust syntrust changed the base branch from 2shards to main September 9, 2024 02:20
@syntrust syntrust merged commit 6d2b0e4 into main Sep 9, 2024
2 checks passed
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.

3 participants