attestantio / vouch

Apache License 2.0
112 stars 28 forks source link

Vouch panics when Dirk can't obtain account / denies permission #15

Closed fkbenjamin closed 3 years ago

fkbenjamin commented 3 years ago

This issue is related to the following issue with Dirk: with https://github.com/attestantio/dirk/issues/8

When Vouch tries to obtain a signature from Dirk and gets denied, it gives out the following error message:

{"level":"error","service":"beaconcommitteesubscriber","impl":"standard","slot":<Slot>,"validator_index":<Index>,"error":"failed to sign the slot: failed to sign RANDO reveal: request to obtain signature denied","time":"2021-02-26T08:52:39+01:00","message":"Failed to calculate if validator is an aggregator"}

It then panics with the following message:

panic: runtime error: index out of range [0] with length 0

goroutine 2589 [running]:
github.com/herumi/bls-eth-go-binary/bls.(*Sign).Deserialize.func1(0xc00106c480, 0xc001a30df8, 0x140)
        /home/vouch/go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20201104034342-d782bdf735de/bls/bls.go:499 +0xc5
github.com/herumi/bls-eth-go-binary/bls.(*Sign).Deserialize(0xc00106c480, 0x0, 0x0, 0x0, 0x12193a0, 0x1)
        /home/vouch/go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20201104034342-d782bdf735de/bls/bls.go:499 +0x39
github.com/wealdtech/go-eth2-types/v2.BLSSignatureFromBytes(0x0, 0x0, 0x0, 0xc0003b1a40, 0x0, 0x0, 0x0)
        /home/vouch/go/pkg/mod/github.com/wealdtech/go-eth2-types/v2@v2.5.1/blssignature.go:29 +0x65
github.com/wealdtech/go-eth2-wallet-dirk.(*account).SignBeaconAttestationsGRPC(0xc00013ae60, 0x153b940, 0xc000dd3410, 0x98a03, 0xc0003b1900, 0x14, 0x14, 0xc00078c460, 0x14, 0x14, ...)
        /home/vouch/go/pkg/mod/github.com/wealdtech/go-eth2-wallet-dirk@v1.1.4/grpc.go:530 +0x718
github.com/wealdtech/go-eth2-wallet-dirk.(*account).SignBeaconAttestations(0xc00013ae60, 0x153b940, 0xc000dd3410, 0x98a03, 0xc0003b1900, 0x14, 0x14, 0xc00078c460, 0x14, 0x14, ...)
        /home/vouch/go/pkg/mod/github.com/wealdtech/go-eth2-wallet-dirk@v1.1.4/account.go:150 +0x185
github.com/attestantio/vouch/services/signer/standard.(*Service).SignBeaconAttestations(0xc00013a190, 0x153b880, 0xc000460140, 0xc0003b1900, 0x14, 0x14, 0x98a03, 0xc00078c1e0, 0x14, 0x14, ...)
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/signer/standard/signbeaconattestations.go:59 +0x54a
github.com/attestantio/vouch/services/attester/standard.(*Service).attest(0xc0006a6ea0, 0x153b880, 0xc000460140, 0x98a03, 0xc001b7ba40, 0xc0003b17c0, 0x14, 0x14, 0xc00078c140, 0x14, ...)
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/attester/standard/service.go:188 +0x237
github.com/attestantio/vouch/services/attester/standard.(*Service).Attest(0xc0006a6ea0, 0x153b880, 0xc000460140, 0x129a460, 0xc001b7ba40, 0x0, 0xc001c420d0, 0x1346580, 0xc001c52d80, 0x756ea100000076)
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/attester/standard/service.go:148 +0xfc5
github.com/attestantio/vouch/services/controller/standard.(*Service).AttestAndScheduleAggregate(0xc00023a0e0, 0x153b880, 0xc000460140, 0x129a460, 0xc001b7ba40)
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/controller/standard/attester.go:122 +0xc9
github.com/attestantio/vouch/services/scheduler/basic.(*Service).ScheduleJob.func1(0x153b880, 0xc000460140, 0xc0002722a0, 0x29, 0xbebc200, 0xed7ca9f7f, 0x1c75c40, 0xc0001adad0, 0xc001785ce0, 0xc001785d40, ...)
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/scheduler/basic/service.go:115 +0x7b2
created by github.com/attestantio/vouch/services/scheduler/basic.(*Service).ScheduleJob
        /home/vouch/go/pkg/mod/github.com/attestantio/vouch@v1.0.3/services/scheduler/basic/service.go:94 +0x414

Restarting Vouch will result in the same panic again. After restarting Dirk, everything goes back to normal.