Skip to content

Commit

Permalink
Merge pull request #1923 from lavanet/PRT-adding-a-more-indicative-er…
Browse files Browse the repository at this point in the history
…ror-for-provider-config

feat: PRT - adding a more indicative error for provider config
  • Loading branch information
ranlavanet authored Jan 22, 2025
2 parents d2c0fdb + d3dd655 commit 3a2b885
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,32 @@ endpoints:
- url: ws://my-eth-node.com/eth/archive/ws
addons:
- archive
- url: http://my-eth-node.com/eth/http/archive
- url: http://my-eth-node.com/eth/http/deubg
addons:
- debug
- url: ws://my-eth-node.com/eth/archive/ws
- url: ws://my-eth-node.com/eth/debug/ws
addons:
- debug
- url: http://my-eth-node.com/eth/http/archive
- url: http://my-eth-node.com/eth/http/trace
addons:
- trace
- url: ws://my-eth-node.com/eth/archive/ws
- url: ws://my-eth-node.com/eth/trace/ws
addons:
- trace
- url: http://my-eth-node.com/eth/http/debug+archive
addons:
- debug
- archive
- url: ws://my-eth-node.com/eth/debug+archive/ws
addons:
- debug
- archive
- url: http://my-eth-node.com/eth/http/trace+archive
addons:
- trace
- archive
- url: ws://my-eth-node.com/eth/trace+archive/ws
addons:
- trace
- archive

7 changes: 7 additions & 0 deletions protocol/chainlib/chain_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavase
}
}
if len(requiredMap) > len(supportedMap) {
missingKeys := []string{}
for key := range requiredMap {
if _, ok := supportedMap[key]; !ok {
missingKeys = append(missingKeys, key)
}
}
utils.LavaFormatError("missing extensions or addons in definitions", nil, utils.Attribute{Key: "missing setups", Value: missingKeys})
return nil, utils.LavaFormatError("not all requirements supported in chainRouter, missing extensions or addons in definitions", nil, utils.Attribute{Key: "required", Value: requiredMap}, utils.Attribute{Key: "supported", Value: supportedMap})
}

Expand Down

0 comments on commit 3a2b885

Please sign in to comment.