Skip to content

Commit

Permalink
Add Monad Testnet Config and Error Mapping (#15993)
Browse files Browse the repository at this point in the history
* add monad testnet

* add remaining config

* nit

* bump down no new heads

* remove redundant

* update finality setting from product

* fix error classification
  • Loading branch information
flodesi authored Jan 23, 2025
1 parent 8f634ec commit f9c3869
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/three-meals-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added Monad Testnet Config
6 changes: 5 additions & 1 deletion core/chains/evm/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,18 @@ var sei = ClientErrors{
Fatal: regexp.MustCompile(`(: |^)'*out of gas|insufficient fee|Tx too large. Max size is \d+, but got \d+|: insufficient funds`),
}

var monad = ClientErrors{
Fatal: regexp.MustCompile("Gas limit too low"),
}

const TerminallyStuckMsg = "transaction terminally stuck"

// Tx.Error messages that are set internally so they are not chain or client specific
var internal = ClientErrors{
TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg),
}

var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, sei, internal}
var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, sei, monad, internal}

// ClientErrorRegexes returns a map of compiled regexes for each error type
func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors {
Expand Down
2 changes: 2 additions & 0 deletions core/chains/evm/client/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ func Test_Eth_Errors_Fatal(t *testing.T) {
{"Tx too large. Max size is 2048576, but got 2097431", true, "Sei"},
{": insufficient funds", true, "Sei"},
{"insufficient fee", true, "Sei"},

{"Gas limit too low", true, "monad"},
}

for _, test := range tests {
Expand Down
24 changes: 24 additions & 0 deletions core/chains/evm/config/toml/defaults/Monad_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ChainID = '10143'
# finality_depth was: 0
FinalityDepth = 120
# block_time was: 1s, adding 1 second buffer
LogPollInterval = '2s'
# No WS Support
LogBroadcasterEnabled = false
FinalityTagEnabled = false
# finality_depth * block_time / 60 secs = < 1 min (finality time)
NoNewFinalizedHeadsThreshold = '1m'
NoNewHeadsThreshold = '1m'

[GasEstimator]
EIP1559DynamicFees = false
Mode = 'FeeHistory'

[GasEstimator.FeeHistory]
CacheTimeout = '2s'

[GasEstimator.BlockHistory]
BlockHistorySize = 100

[NodePool]
NewHeadsPollInterval = '4s'
107 changes: 107 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8526,6 +8526,113 @@ GasLimitDefault = 400000

</p></details>

<details><summary>Monad Testnet (10143)</summary><p>

```toml
AutoCreateKey = true
BlockBackfillDepth = 10
BlockBackfillSkip = false
FinalityDepth = 120
FinalityTagEnabled = false
LogBackfillBatchSize = 1000
LogPollInterval = '2s'
LogKeepBlocksDepth = 100000
LogPrunePageSize = 0
BackupLogPollerBlockDelay = 100
MinIncomingConfirmations = 3
MinContractPayment = '0.00001 link'
NonceAutoSync = true
NoNewHeadsThreshold = '1m0s'
LogBroadcasterEnabled = false
RPCDefaultBatchSize = 250
RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1m0s'

[Transactions]
Enabled = true
ForwardersEnabled = false
MaxInFlight = 16
MaxQueued = 250
ReaperInterval = '1h0m0s'
ReaperThreshold = '168h0m0s'
ResendAfterThreshold = '1m0s'

[Transactions.AutoPurge]
Enabled = false

[Transactions.TransactionManagerV2]
Enabled = false

[BalanceMonitor]
Enabled = true

[GasEstimator]
Mode = 'FeeHistory'
PriceDefault = '20 gwei'
PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether'
PriceMin = '1 gwei'
LimitDefault = 500000
LimitMax = 500000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
EIP1559DynamicFees = false
FeeCapDefault = '100 gwei'
TipCapDefault = '1 wei'
TipCapMin = '1 wei'

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 100
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '2s'

[HeadTracker]
HistoryDepth = 100
MaxBufferSize = 3
SamplingInterval = '1s'
MaxAllowedFinalityDepth = 10000
FinalityTagBypass = true
PersistenceEnabled = true

[NodePool]
PollFailureThreshold = 5
PollInterval = '10s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
LeaseDuration = '0s'
NodeIsSyncingEnabled = false
FinalizedBlockPollInterval = '5s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NewHeadsPollInterval = '4s'

[OCR]
ContractConfirmations = 4
ContractTransmitterTransmitTimeout = '10s'
DatabaseTimeout = '10s'
DeltaCOverride = '168h0m0s'
DeltaCJitterOverride = '1h0m0s'
ObservationGracePeriod = '1s'

[OCR2]
[OCR2.Automation]
GasLimit = 5400000

[Workflow]
GasLimitDefault = 400000
```

</p></details>

<details><summary>Gnosis Chiado (10200)</summary><p>

```toml
Expand Down

0 comments on commit f9c3869

Please sign in to comment.