bridge/pkg/ethereum: remove channel unsubscribes

Unsubscribe() does blocking I/O that ignores the runnable context
and can block forever: #107

It would appear that removing the Unsubscribe calls is the only
way to work around this go-ethereum bug.

ghstack-source-id: 93f287efc0
Pull Request resolved: https://github.com/certusone/wormhole/pull/109
This commit is contained in:
Leo 2020-11-19 12:53:19 +01:00
parent 66430cb5be
commit a3c745ace7
1 changed files with 0 additions and 3 deletions

View File

@ -70,7 +70,6 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
if err != nil {
return fmt.Errorf("failed to subscribe to token lockup events: %w", err)
}
defer tokensLockedSub.Unsubscribe()
// Subscribe to guardian set changes
guardianSetC := make(chan *abi.AbiLogGuardianSetChanged, 2)
@ -78,7 +77,6 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
if err != nil {
return fmt.Errorf("failed to subscribe to guardian set events: %w", err)
}
defer tokensLockedSub.Unsubscribe()
errC := make(chan error)
logger := supervisor.Logger(ctx)
@ -167,7 +165,6 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
if err != nil {
return fmt.Errorf("failed to subscribe to header events: %w", err)
}
defer headerSubscription.Unsubscribe()
go func() {
for {