Skip to content

Commit

Permalink
Introduce generalized multi node client (#10907)
Browse files Browse the repository at this point in the history
* Introduce generalized multi node client

* Export EVM RPC client

* Unexport clientAPI interface

* Add BlockDifficulty to mocks

* Unexport node state

* Rename error parsing

* Nit fixes

* Rename error classification functions

* Update NodeSelection names

* Deprecate StartStopOnce
  • Loading branch information
dimriou authored Nov 1, 2023
1 parent fda4393 commit 08c9f89
Show file tree
Hide file tree
Showing 25 changed files with 4,110 additions and 137 deletions.
22 changes: 22 additions & 0 deletions common/chains/client/models.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package client

import (
"fmt"
)

type SendTxReturnCode int

// SendTxReturnCode is a generalized client error that dictates what should be the next action, depending on the RPC error response.
Expand All @@ -15,3 +19,21 @@ const (
ExceedsMaxFee // Attempt's fee was higher than the node's limit and got rejected.
FeeOutOfValidRange // This error is returned when we use a fee price suggested from an RPC, but the network rejects the attempt due to an invalid range(mostly used by L2 chains). Retry by requesting a new suggested fee price.
)

type NodeTier int

const (
Primary = NodeTier(iota)
Secondary
)

func (n NodeTier) String() string {
switch n {
case Primary:
return "primary"
case Secondary:
return "secondary"
default:
return fmt.Sprintf("NodeTier(%d)", n)
}
}
Loading

0 comments on commit 08c9f89

Please sign in to comment.