diff --git a/app/process/watcher/evm/watcher.go b/app/process/watcher/evm/watcher.go index d8b284613..81622b6ef 100644 --- a/app/process/watcher/evm/watcher.go +++ b/app/process/watcher/evm/watcher.go @@ -165,15 +165,13 @@ func (ew *Watcher) listenForEvents(q qi.Queue) { burnSubscription, err := ew.contracts.WatchBurnEventLogs(nil, burnEvents) if err != nil { - ew.logger.Errorf("Failed to subscribe for Burn Event Logs for contract address [%s]. Error [%s].", ew.contracts.Address(), err) - return + ew.logger.Fatalf("Failed to subscribe for Burn Event Logs for contract address [%s]. Error [%s].", ew.contracts.Address(), err) } lockEvents := make(chan *router.RouterLock) lockSubscription, err := ew.contracts.WatchLockEventLogs(nil, lockEvents) if err != nil { - ew.logger.Errorf("Failed to subscribe for Lock Event Logs for contract address [%s]. Error [%s].", ew.contracts.Address(), err) - return + ew.logger.Fatalf("Failed to subscribe for Lock Event Logs for contract address [%s]. Error [%s].", ew.contracts.Address(), err) } for { diff --git a/app/process/watcher/evm/watcher_test.go b/app/process/watcher/evm/watcher_test.go index f75feb882..ff847320f 100644 --- a/app/process/watcher/evm/watcher_test.go +++ b/app/process/watcher/evm/watcher_test.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/hashgraph/hedera-sdk-go/v2" @@ -507,21 +506,6 @@ func Test_HandleLockLog_GetBlockTimestamp_Fails(t *testing.T) { mocks.MQueue.AssertNotCalled(t, "Push", mock.Anything) } -func Test_ListenForEvents_BurnSubscription_Fails(t *testing.T) { - setup() - var opts *bind.WatchOpts = nil - mocks.MBridgeContractService.On("WatchBurnEventLogs", opts, mock.Anything).Return(nil, errors.New("some-error")) - w.listenForEvents(mocks.MQueue) -} - -func Test_ListenForEvents_LockSubscription_Fails(t *testing.T) { - setup() - var opts *bind.WatchOpts = nil - mocks.MBridgeContractService.On("WatchBurnEventLogs", opts, mock.Anything).Return(nil, nil) - mocks.MBridgeContractService.On("WatchLockEventLogs", opts, mock.Anything).Return(nil, errors.New("some-error")) - w.listenForEvents(mocks.MQueue) -} - func Test_HandleBurnLog_Token_Not_Supported(t *testing.T) { setup() mocks.MEVMClient.On("ChainID", context.Background()).Return(big.NewInt(33), nil) diff --git a/docker-compose.yml b/docker-compose.yml index 9f82c0b24..633b8d365 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.3" services: db: image: postgres:9.6-alpine - restart: unless-stopped + restart: always stop_grace_period: 2m stop_signal: SIGTERM tty: true @@ -19,7 +19,7 @@ services: image: gcr.io/hedera-eth-bridge-test/hedera-eth-bridge-validator:latest environment: VALIDATOR_DATABASE_HOST: db - restart: unless-stopped + restart: always tty: true volumes: - ./bridge.yml:/src/hedera-eth-bridge-validator/config/bridge.yml diff --git a/examples/three-validators/docker-compose.yml b/examples/three-validators/docker-compose.yml index 275276719..37f55bd2c 100644 --- a/examples/three-validators/docker-compose.yml +++ b/examples/three-validators/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.3" services: alice_db: image: postgres:9.6-alpine - restart: unless-stopped + restart: always stop_grace_period: 2m stop_signal: SIGTERM tty: true @@ -17,7 +17,7 @@ services: - 6432:5432 bob_db: image: postgres:9.6-alpine - restart: unless-stopped + restart: always stop_grace_period: 2m stop_signal: SIGTERM tty: true @@ -32,7 +32,7 @@ services: - 7432:5432 carol_db: image: postgres:9.6-alpine - restart: unless-stopped + restart: always stop_grace_period: 2m stop_signal: SIGTERM tty: true @@ -47,7 +47,7 @@ services: - 8432:5432 dave_db: image: postgres:9.6-alpine - restart: unless-stopped + restart: always stop_grace_period: 2m stop_signal: SIGTERM tty: true @@ -70,7 +70,7 @@ services: volumes: - ./bridge.yml:/src/hedera-eth-bridge-validator/config/bridge.yml - ./alice/config/node.yml:/src/hedera-eth-bridge-validator/config/node.yml - restart: unless-stopped + restart: always tty: true ports: - 6200:5200 @@ -83,7 +83,7 @@ services: volumes: - ./bridge.yml:/src/hedera-eth-bridge-validator/config/bridge.yml - ./bob/config/node.yml:/src/hedera-eth-bridge-validator/config/node.yml - restart: unless-stopped + restart: always tty: true ports: - 7200:5200 @@ -96,7 +96,7 @@ services: volumes: - ./bridge.yml:/src/hedera-eth-bridge-validator/config/bridge.yml - ./carol/config/node.yml:/src/hedera-eth-bridge-validator/config/node.yml - restart: unless-stopped + restart: always tty: true ports: - 8200:5200 @@ -109,7 +109,7 @@ services: volumes: - ./bridge.yml:/src/hedera-eth-bridge-validator/config/bridge.yml - ./dave/config/node.yml:/src/hedera-eth-bridge-validator/config/node.yml - restart: unless-stopped + restart: always tty: true ports: - 9200:5200