-
Notifications
You must be signed in to change notification settings - Fork 5
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
Serial nonce update #74
Merged
Merged
Conversation
This file contains 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
goran-ethernal
force-pushed
the
serial-nonce-update
branch
from
September 30, 2024 09:26
df24d82
to
d8ef500
Compare
goran-ethernal
force-pushed
the
serial-nonce-update
branch
from
September 30, 2024 09:30
d8ef500
to
df99ab4
Compare
ToniRamirezM
approved these changes
Sep 30, 2024
goran-ethernal
added a commit
that referenced
this pull request
Oct 2, 2024
* feat: prepare txns before routines * fix: remove forcedNonce feature * feat: uts * fix: lint
goran-ethernal
added a commit
that referenced
this pull request
Oct 2, 2024
* Serial nonce update (#74) * feat: prepare txns before routines * fix: remove forcedNonce feature * feat: uts * fix: lint * lint fix --------- Co-authored-by: Goran Rojovic <100121253+goran-ethernal@users.noreply.github.com> Co-authored-by: Goran Rojovic <goran.rojovic@ethernal.tech>
KamiD
pushed a commit
to okx/xlayer-ethtx-manager
that referenced
this pull request
Nov 14, 2024
* option to avoid gas estimationi * Quality Gate (0xPolygon#61) * add linters * fix: lint fix * fix: lint make file * feat: sonar * fix: remove unused files * try to include coverage * fix: change sonar cloud project key * small fix * fix: comments --------- Co-authored-by: Rachit Sonthalia <rachitsonthalia02@gmail.com> * ensure tx order (0xPolygon#64) * ensure tx order * fix: linter * change namespace (0xPolygon#65) * fix nonce too low (0xPolygon#67) * Nonce too low issues fix (0xPolygon#75) * Serial nonce update (0xPolygon#74) * feat: prepare txns before routines * fix: remove forcedNonce feature * feat: uts * fix: lint * lint fix --------- Co-authored-by: Goran Rojovic <100121253+goran-ethernal@users.noreply.github.com> Co-authored-by: Goran Rojovic <goran.rojovic@ethernal.tech> * feat: implement SQL lite storage (0xPolygon#72) * feat: initial scaffolding * feat: insert implementation * feat: change column types based on the SQL lite supported types * feat: changed schema, first version of CRUD operations implementation * refactor: extract common parts to helper functions * chore: add comments * fix: linter config warning * refactor: simplify in-memory storage and fix deadlocks in case of errors * feat: instantiate either in memory or sql storage * chore: add comment * test: fully covered memstorage feat minor renames * feat: add github.com/mattn/go-sqlite3 as direct dependency * fix: adapt the DB schema, fix issues and add unit tests for sql storage * feat: increase coverage * test: add some more unit tests * fix: group variables * refactor: rename PersistenceFilename config parameter * fix: rename helper function (address comment part 1) * feat: introduce meddler * chore: remove useless comments * fix: revert update logic to manually constructing SQL and address comments from @joanestebanr (part 1) * fix: change some columns types (address comment from @joanestebanr 2nd part) * fix: use meddler to construct on fly update statement, address comments from @joanestebanr (part 3) * feat: remove in memory storage, change block_number to BIGINT (address @joanestebanr part 4) * fix: remove redundant code * feat: simplify building of UPDATE clause * rebase fix * refactor: build base select and base delete statement dynamically (address comment from @arnaubennassar) * test: concurrent write to the database unit test --------- Co-authored-by: Goran Rojovic <goran.rojovic@ethernal.tech> * Rename config parameter `DBPath` to `StoragePath` (0xPolygon#77) * fix if a tx is finalized very fast (0xPolygon#84) * fix * comment * # This is a combination of 3 commits. # This is the 1st commit message: Merge `dev` into upstream v0.2.1 # This is the commit message #2: Fix lint errs # This is the commit message #3: Comment interface method * parent 4da7722 author Vui-Chee <vuicheesiew@gmail.com> 1731548943 +0800 committer Vui-Chee <vuicheesiew@gmail.com> 1731548943 +0800 parent 1b8de9d author Vui-Chee <vuicheesiew@gmail.com> 1731476344 +0800 committer Vui-Chee <vuicheesiew@gmail.com> 1731548582 +0800 Merge `dev` into upstream v0.2.1 Fix lint errs Comment interface method Fix configure (#3) * fix configure * keep the same with genesis Silence sonar cloud go mod tidy Add back hex ut to keep consistent with `dev` --------- Co-authored-by: Arnau <arnaubennassar5@gmail.com> Co-authored-by: Goran Rojovic <100121253+goran-ethernal@users.noreply.github.com> Co-authored-by: Rachit Sonthalia <rachitsonthalia02@gmail.com> Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com> Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com> Co-authored-by: Goran Rojovic <goran.rojovic@ethernal.tech> Co-authored-by: Alonso Rodriguez <ARR552@users.noreply.github.com>
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.
What does this PR do?
This PR introduces update of nonce in serial manner, before firing go routines for each monitored txn, to avoid
nonce too low
issue.Key Changes:
Removed
getTxNonce
method and associated nonce handling logic.Updated
add
method to removemutex
locks and forced nonce checks.Refactored
monitorTxs
to use a new iteration structure.Simplified
monitorTx
method to use the new iteration structure and removed detailed nonce review logic.Introduced
getMonitoredTxnIteration
method to handle nonce updates in a batch manner before processing transactions.Technical Overview:
The changes streamline the nonce update process by removing
mutex
locks and detailed nonce review logic, replacing them with a more efficient batch update mechanism. The newmonitoredTxnIteration
struct encapsulates the transaction data and its associated state, allowing for more straightforward and efficient monitoring and nonce updates. This refactor aims to reduce the chances of encountering nonce conflicts and improve the overall transaction handling efficiency.Reviewers
Main reviewers:
Codeowner reviewers: