-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract sequence tracking from the Broadcaster (#12353)
* Extracted sequence tracking from the Broadcaster into a separate component * Fixed test and linting * Updated NonceTracker to use TXM client * Fixed tests * Moved NonceTracker initialization into the EVM Broadcaster builder * Fixed issue with in-progress tx during startup * Fixed linting * Added changeset * Updated changeset message --------- Co-authored-by: Prashant Yadav <[email protected]>
- Loading branch information
1 parent
331c1cb
commit 07c9f6c
Showing
17 changed files
with
625 additions
and
739 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"chainlink": patch | ||
--- | ||
|
||
Fixed a race condition bug around EVM nonce management, which could cause the Node to skip a nonce and get stuck. |
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package types | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/smartcontractkit/chainlink-common/pkg/services" | ||
"github.com/smartcontractkit/chainlink/v2/common/types" | ||
) | ||
|
||
type SequenceTracker[ | ||
// Represents an account address, in native chain format. | ||
ADDR types.Hashable, | ||
// Represents the sequence type for a chain. For example, nonce for EVM. | ||
SEQ types.Sequence, | ||
] interface { | ||
// Load the next sequence needed for transactions for all enabled addresses | ||
LoadNextSequences(context.Context, []ADDR) | ||
// Get the next sequence to assign to a transaction | ||
GetNextSequence(context.Context, ADDR) (SEQ, error) | ||
// Signals the existing sequence has been used so generates and stores the next sequence | ||
// Can be a no-op depending on the chain | ||
GenerateNextSequence(ADDR, SEQ) | ||
// Syncs the local sequence with the one on-chain in case the address as been used externally | ||
// Can be a no-op depending on the chain | ||
SyncSequence(context.Context, ADDR, services.StopChan) | ||
} |
Oops, something went wrong.