Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions graft/coreth/plugin/evm/vm_warp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,11 @@ func testWarpVMTransaction(t *testing.T, scheme string, unsignedMessage *avalanc
vdrs := validators.WarpSet{
Validators: []*validators.Warp{
{
PublicKey: blsPublicKey1,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(blsPublicKey1),
Weight: 50,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: blsPublicKey2,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(blsPublicKey2),
Weight: 50,
NodeIDs: []ids.NodeID{nodeID2},
Expand Down Expand Up @@ -665,7 +663,6 @@ func testReceiveWarpMessage(
for _, s := range signers {
pk := s.secret.PublicKey()
vdrs.Validators = append(vdrs.Validators, &validators.Warp{
PublicKey: pk,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk),
Weight: s.weight,
NodeIDs: []ids.NodeID{s.nodeID},
Expand Down
3 changes: 0 additions & 3 deletions graft/subnet-evm/plugin/evm/vm_warp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,11 @@ func testWarpVMTransaction(t *testing.T, scheme string, unsignedMessage *avalanc
vdrs := validators.WarpSet{
Validators: []*validators.Warp{
{
PublicKey: blsPublicKey1,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(blsPublicKey1),
Weight: 50,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: blsPublicKey2,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(blsPublicKey2),
Weight: 50,
NodeIDs: []ids.NodeID{nodeID2},
Expand Down Expand Up @@ -687,7 +685,6 @@ func testReceiveWarpMessage(
for _, s := range signers {
pk := s.secret.PublicKey()
vdrs.Validators = append(vdrs.Validators, &validators.Warp{
PublicKey: pk,
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk),
Weight: s.weight,
NodeIDs: []ids.NodeID{s.nodeID},
Expand Down
2 changes: 1 addition & 1 deletion network/p2p/acp118/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (r *responseHandler) HandleResponse(
return
}

if !bls.Verify(validator.PublicKey, signature, r.message.UnsignedMessage.Bytes()) {
if !bls.Verify(validator.PublicKey(), signature, r.message.UnsignedMessage.Bytes()) {
r.results <- result{NodeID: nodeID, Validator: validator, Err: errFailedVerification}
return
}
Expand Down
188 changes: 94 additions & 94 deletions network/p2p/acp118/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
},
wantTotalStake: 1,
Expand Down Expand Up @@ -108,9 +108,9 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
},
wantTotalStake: 1,
Expand Down Expand Up @@ -139,9 +139,9 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
},
wantTotalStake: 1,
Expand Down Expand Up @@ -172,19 +172,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 3,
Expand Down Expand Up @@ -215,19 +215,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 3,
Expand Down Expand Up @@ -258,19 +258,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 3,
Expand Down Expand Up @@ -301,19 +301,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 3,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 3,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 6,
Expand Down Expand Up @@ -344,19 +344,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 3,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 3,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 6,
Expand Down Expand Up @@ -387,19 +387,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 2,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 7,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 7,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 10,
Expand Down Expand Up @@ -430,9 +430,9 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0, nodeID1, nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0, nodeID1, nodeID2},
},
},
wantTotalStake: 1,
Expand Down Expand Up @@ -463,14 +463,14 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1, nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1, nodeID2},
},
},
wantTotalStake: 2,
Expand Down Expand Up @@ -504,9 +504,9 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
},
wantTotalStake: 1,
Expand Down Expand Up @@ -541,19 +541,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 3,
Expand Down Expand Up @@ -592,19 +592,19 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
}(),
validators: []*validators.Warp{
{
PublicKey: pk0,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk0),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID0},
},
{
PublicKey: pk1,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk1),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID1},
},
{
PublicKey: pk2,
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
PublicKeyBytes: bls.PublicKeyToUncompressedBytes(pk2),
Weight: 1,
NodeIDs: []ids.NodeID{nodeID2},
},
},
wantTotalStake: 3,
Expand Down Expand Up @@ -654,7 +654,7 @@ func TestSignatureAggregator_AggregateSignatures(t *testing.T) {
continue
}

pks = append(pks, tt.validators[i].PublicKey)
pks = append(pks, tt.validators[i].PublicKey())
wantAggregatedStake += tt.validators[i].Weight
}

Expand Down
Loading
Loading