Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chains/heads/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func (t *tracker[HTH, S, ID, BHASH]) backfill(ctx context.Context, head, latestF
}

if head.BlockHash() != latestFinalizedHead.BlockHash() {
t.log.Criticalw("Finalized block missing from conical chain",
t.log.Criticalw("Finalized block missing from canonical chain",
"finalized_block_number", latestFinalizedHead.BlockNumber(), "finalized_hash", latestFinalizedHead.BlockHash(),
"canonical_chain_block_number", head.BlockNumber(), "canonical_chain_hash", head.BlockHash())
return FinalizedMissingError[BHASH]{latestFinalizedHead.BlockHash(), head.BlockHash()}
Expand Down
1 change: 0 additions & 1 deletion multinode/send_only_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (s *sendOnlyNode[CHAIN_ID, RPC]) start() {
if err != nil || chainID.String() != s.chainID.String() {
s.metrics.IncrementNodeTransitionsToUnreachable(ctx, s.name)
if err != nil {
s.metrics.IncrementNodeTransitionsToUnreachable(ctx, s.name)
s.log.Errorw(fmt.Sprintf("Verify failed: %v", err), "err", err)
s.setState(nodeStateUnreachable)
} else {
Expand Down
11 changes: 9 additions & 2 deletions multinode/send_only_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ func TestStartSendOnlyNode(t *testing.T) {
client := newMockSendOnlyClient[ID](t)
client.On("Close").Once()
client.On("Dial", mock.Anything).Return(nil)
metrics := makeMockNodeMetrics(t)
expectedError := errors.New("failed to get chain ID")
chainID := RandomID()
const failuresCount = 2
client.On("ChainID", mock.Anything).Return(RandomID(), expectedError).Times(failuresCount)

s := NewSendOnlyNode(lggr, makeMockNodeMetrics(t), url.URL{}, t.Name(), chainID, client)
s := NewSendOnlyNode(lggr, metrics, url.URL{}, t.Name(), chainID, client)

defer func() { assert.NoError(t, s.Close()) }()
err := s.Start(tests.Context(t))
Expand All @@ -93,6 +94,8 @@ func TestStartSendOnlyNode(t *testing.T) {
tests.AssertLogCountEventually(t, observedLogs, fmt.Sprintf("Verify failed: %v", expectedError), failuresCount)
client.On("ChainID", mock.Anything).Return(chainID, nil)
tests.AssertEventually(t, func() bool { return s.State() == nodeStateAlive })
metrics.AssertNumberOfCalls(t, "IncrementNodeTransitionsToUnreachable", 1)
metrics.AssertNumberOfCalls(t, "IncrementNodeTransitionsToAlive", 1)
})
t.Run("Can recover from chainID mismatch", func(t *testing.T) {
t.Parallel()
Expand All @@ -105,7 +108,8 @@ func TestStartSendOnlyNode(t *testing.T) {
const failuresCount = 2
client.On("ChainID", mock.Anything).Return(rpcChainID, nil).Times(failuresCount)
client.On("ChainID", mock.Anything).Return(configuredChainID, nil)
s := NewSendOnlyNode(lggr, makeMockNodeMetrics(t), url.URL{}, t.Name(), configuredChainID, client)
metrics := makeMockNodeMetrics(t)
s := NewSendOnlyNode(lggr, metrics, url.URL{}, t.Name(), configuredChainID, client)

defer func() { assert.NoError(t, s.Close()) }()
err := s.Start(tests.Context(t))
Expand All @@ -117,6 +121,9 @@ func TestStartSendOnlyNode(t *testing.T) {
tests.AssertEventually(t, func() bool {
return s.State() == nodeStateAlive
})
metrics.AssertNumberOfCalls(t, "IncrementNodeTransitionsToUnreachable", 1)
metrics.AssertNumberOfCalls(t, "IncrementNodeTransitionsToInvalidChainID", 1)
metrics.AssertNumberOfCalls(t, "IncrementNodeTransitionsToAlive", 1)
})
t.Run("Start with Random ChainID", func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion tools/evm-chain-bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ With probably plenty of bugs to be fixed, the POC supports:
- Simple and complex types inputs and outputs.
- Basic chain reader and chain writer configuration but works for simple use cases.

Solidity primitive types to Go primitive types are not fully mapped. If you encounter an issue regarding type mapping you can update the code in internal/gen/evm/solity_types_mapping.go
Solidity primitive types to Go primitive types are not fully mapped. If you encounter an issue regarding type mapping you can update the code in pkg/gen/evm/solidity_types_mapping.go

## Troubleshooting and issue reporting

Expand Down
Loading