Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relaying 2/3 signatures correctly #629

Merged
Merged
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
10 changes: 4 additions & 6 deletions x/qgb/orchestrator/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

"github.com/cosmos/cosmos-sdk/types/errors"
tmlog "github.com/tendermint/tendermint/libs/log"

"github.com/celestiaorg/celestia-app/x/qgb/types"
Expand Down Expand Up @@ -183,19 +182,18 @@ func (r *Relayer) submitDataRootTupleRoot(

// matchAttestationConfirmSigs matches and sorts the confirm signatures with the valset
// members as expected by the QGB contract.
// Also, it leaves the non provided signatures as nil in the `sigs` slice:
// https://github.com/celestiaorg/celestia-app/issues/628
func matchAttestationConfirmSigs(
signatures map[string]string,
currentValset types.Valset,
) ([]wrapper.Signature, error) {
sigs := make([]wrapper.Signature, len(signatures))
sigs := make([]wrapper.Signature, len(currentValset.Members))
// the QGB contract expects the signatures to be ordered by validators in valset
for i, val := range currentValset.Members {
sig, has := signatures[val.EthereumAddress]
if !has {
return nil, errors.Wrap(
ErrConfirmSignatureNotFound,
fmt.Sprintf("missing signature for orchestrator eth address: %s", val.EthereumAddress),
)
continue
}
v, r, s := SigToVRS(sig)

Expand Down