Skip to content

Commit

Permalink
Merge pull request #493 from tablelandnetwork/avichalp/arbitrum-nova
Browse files Browse the repository at this point in the history
Add arbitrum nova config
  • Loading branch information
avichalp authored Mar 28, 2023
2 parents 8b30e07 + 8154e15 commit 2f4d211
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
27 changes: 27 additions & 0 deletions docker/deployed/mainnet/api/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@
},
"HashCalculationStep": 450
},
{
"Name": "Arbitrum Nova Mainnet",
"ChainID": 42170,
"Registry": {
"EthEndpoint": "https://skilled-yolo-mountain.nova-mainnet.discover.quiknode.pro/${VALIDATOR_QUICKNODE_ARBITRUM_NOVA_MAINNET_API_KEY}",
"ContractAddress": "0x1A22854c5b1642760a827f20137a67930AE108d2"
},
"Signer": {
"PrivateKey": "${VALIDATOR_ARBITRUM_NOVA_MAINNET_SIGNER_PRIVATE_KEY}"
},
"EventFeed": {
"ChainAPIBackoff": "15s",
"NewBlockPollFreq": "5s",
"MinBlockDepth": 0,
"PersistEvents": true
},
"EventProcessor": {
"BlockFailedExecutionBackoff": "10s",
"DedupExecutedTxns": true
},
"NonceTracker": {
"CheckInterval": "20s",
"StuckInterval": "10m",
"MinBlockDepth": 0
},
"HashCalculationStep": 450
},
{
"Name": "Polygon Mainnet",
"ChainID": 137,
Expand Down
13 changes: 13 additions & 0 deletions pkg/client/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var ChainIDs = struct {
Optimism ChainID
Polygon ChainID
Arbitrum ChainID
ArbitrumNova ChainID
EthereumGoerli ChainID
OptimismGoerli ChainID
ArbitrumGoerli ChainID
Expand All @@ -29,6 +30,7 @@ var ChainIDs = struct {
Optimism: 10,
Polygon: 137,
Arbitrum: 42161,
ArbitrumNova: 42170,
EthereumGoerli: 5,
OptimismGoerli: 420,
ArbitrumGoerli: 421613,
Expand Down Expand Up @@ -70,6 +72,12 @@ var Chains = map[ChainID]Chain{
Name: "Arbitrum",
ContractAddr: common.HexToAddress("0x9aBd75E8640871A5a20d3B4eE6330a04c962aFfd"),
},
ChainIDs.ArbitrumNova: {
Endpoint: mainnetURL,
ID: ChainIDs.ArbitrumNova,
Name: "Arbitrum Nova",
ContractAddr: common.HexToAddress("0x1a22854c5b1642760a827f20137a67930ae108d2"),
},
ChainIDs.EthereumGoerli: {
Endpoint: testnetURL,
ID: ChainIDs.EthereumGoerli,
Expand Down Expand Up @@ -131,6 +139,11 @@ var AlchemyURLs = map[ChainID]string{
ChainIDs.Polygon: "https://polygon-mainnet.g.alchemy.com/v2/%s",
}

// QuickNodeURLs contains the URLs for supported chains for QuickNode.
var QuickNodeURLs = map[ChainID]string{
ChainIDs.ArbitrumNova: "https://skilled-yolo-mountain.nova-mainnet.discover.quiknode.pro/%s",
}

// LocalURLs contains the URLs for a local network.
var LocalURLs = map[ChainID]string{
ChainIDs.Local: "http://localhost:8545",
Expand Down
3 changes: 2 additions & 1 deletion pkg/eventprocessor/eventfeed/impl/eventfeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ func (ef *EventFeed) Start(
ef.log.Warn().Err(err).Msgf("filter logs from %d to %d", fromHeight, toHeight)
if strings.Contains(err.Error(), "read limit exceeded") ||
strings.Contains(err.Error(), "Log response size exceeded") ||
strings.Contains(err.Error(), "is greater than the limit") {
strings.Contains(err.Error(), "is greater than the limit") ||
strings.Contains(err.Error(), "eth_getLogs and eth_newFilter are limited to a 10,000 blocks range") {
ef.maxBlocksFetchSize = ef.maxBlocksFetchSize * 80 / 100
} else {
time.Sleep(ef.config.ChainAPIBackoff)
Expand Down

0 comments on commit 2f4d211

Please sign in to comment.