Bump avago master (#1316)

* bump avalanchego to master

* go mod tidy
This commit is contained in:
Darioush Jalali
2024-08-29 09:21:56 -07:00
committed by GitHub
parent 4bd95875b7
commit feed42f7bf
6 changed files with 33 additions and 33 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ go 1.21.12
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/antithesishq/antithesis-sdk-go v0.3.8
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc
github.com/ava-labs/avalanchego v1.11.11-monitoring-url.0.20240827194054-0117ab96791c
github.com/cespare/cp v0.1.0
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
github.com/davecgh/go-spew v1.1.1
+2 -2
View File
@@ -58,8 +58,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8=
github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc h1:cUz1N+LJIeQAR0Z6zTBiuZ7s8GqIE5QQbRWs423VFRA=
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
github.com/ava-labs/avalanchego v1.11.11-monitoring-url.0.20240827194054-0117ab96791c h1:WAbq2clkTkoxELkCePFe7sqwOvD32SZPzoWtciUmzQI=
github.com/ava-labs/avalanchego v1.11.11-monitoring-url.0.20240827194054-0117ab96791c/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 h1:6aIHp7wbyGVYdhHVQUbG7BEcbCMEQ5SYopPPJyipyvk=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180/go.mod h1:/wNBVq7J7wlC2Kbov7kk6LV5xZvau7VF9zwTVOeyAjY=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
@@ -25,7 +25,6 @@ import (
"github.com/ava-labs/subnet-evm/predicate"
"github.com/ava-labs/subnet-evm/utils"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
)
const pChainHeight uint64 = 1337
@@ -49,7 +48,6 @@ var (
numTestVdrs = 10_000
testVdrs []*testValidator
vdrs map[ids.NodeID]*validators.GetValidatorOutput
tests []signatureTest
predicateTests = make(map[string]testutils.PredicateTest)
)
@@ -132,15 +130,6 @@ func newTestValidator() *testValidator {
}
}
type signatureTest struct {
name string
stateF func(*gomock.Controller) validators.State
quorumNum uint64
quorumDen uint64
msgF func(*require.Assertions) *avalancheWarp.Message
err error
}
// createWarpMessage constructs a signed warp message using the global variable [unsignedMsg]
// and the first [numKeys] signatures from [blsSignatures]
func createWarpMessage(numKeys int) *avalancheWarp.Message {
@@ -10,6 +10,7 @@ import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/validators"
"github.com/ava-labs/avalanchego/snow/validators/validatorsmock"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
"github.com/ava-labs/avalanchego/utils/set"
avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp"
@@ -17,14 +18,23 @@ import (
"go.uber.org/mock/gomock"
)
// This test copies the test coverage from https://github.com/ava-labs/avalanchego/blob/v1.10.0/vms/platformvm/warp/signature_test.go#L137.
type signatureTest struct {
name string
stateF func(*gomock.Controller) validators.State
quorumNum uint64
quorumDen uint64
msgF func(*require.Assertions) *avalancheWarp.Message
err error
}
// This test copies the test coverage from https://github.com/ava-labs/avalanchego/blob/0117ab96/vms/platformvm/warp/signature_test.go#L137.
// These tests are only expected to fail if there is a breaking change in AvalancheGo that unexpectedly changes behavior.
func TestSignatureVerification(t *testing.T) {
tests = []signatureTest{
tests := []signatureTest{
{
name: "can't get subnetID",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, errTest)
return state
},
@@ -50,7 +60,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "can't get validator set",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(nil, errTest)
return state
@@ -77,7 +87,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "weight overflow",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(map[ids.NodeID]*validators.GetValidatorOutput{
testVdrs[0].nodeID: {
@@ -117,7 +127,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "invalid bit set index",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -147,7 +157,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "unknown index",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -180,7 +190,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "insufficient weight",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -224,7 +234,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "can't parse sig",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -258,7 +268,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "no validators",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(nil, nil)
return state
@@ -293,7 +303,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "invalid signature (substitute)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -337,7 +347,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "invalid signature (missing one)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -377,7 +387,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "invalid signature (extra one)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -422,7 +432,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "valid signature",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -466,7 +476,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "valid signature (boundary)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(vdrs, nil)
return state
@@ -510,7 +520,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "valid signature (missing key)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(map[ids.NodeID]*validators.GetValidatorOutput{
testVdrs[0].nodeID: {
@@ -571,7 +581,7 @@ func TestSignatureVerification(t *testing.T) {
{
name: "valid signature (duplicate key)",
stateF: func(ctrl *gomock.Controller) validators.State {
state := validators.NewMockState(ctrl)
state := validatorsmock.NewState(ctrl)
state.EXPECT().GetSubnetID(gomock.Any(), sourceChainID).Return(sourceSubnetID, nil)
state.EXPECT().GetValidatorSet(gomock.Any(), pChainHeight, sourceSubnetID).Return(map[ids.NodeID]*validators.GetValidatorOutput{
testVdrs[0].nodeID: {
+1 -1
View File
@@ -4,7 +4,7 @@
# shellcheck disable=SC2034
# Don't export them as they're used in the context of other calls
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'35c66e33'}
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'0117ab96'}
GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'}
# This won't be used, but it's here to make code syncs easier
+2 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/validators"
"github.com/ava-labs/avalanchego/snow/validators/validatorsmock"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/subnet-evm/utils"
"github.com/stretchr/testify/require"
@@ -22,7 +23,7 @@ func TestGetValidatorSetPrimaryNetwork(t *testing.T) {
mySubnetID := ids.GenerateTestID()
otherSubnetID := ids.GenerateTestID()
mockState := validators.NewMockState(ctrl)
mockState := validatorsmock.NewState(ctrl)
snowCtx := utils.TestSnowContext()
snowCtx.SubnetID = mySubnetID
snowCtx.ValidatorState = mockState