Skip to content

Commit acea723

Browse files
timwu20qdm12
andcommitted
fix(ci): embed old gssmr and dev runtimes for integration tests (#2671)
* restore old chain as gssmr-v3substrate, add genesis utils, update TestNodeRuntime_ValidateTransaction * upgrade chaindb * add todos to create new issues, test against old runtime * use v3substrate runtime for dot/core integration tests * lib/babe integration tests use old dev runtime * fix lint * fix grandpa stress tests * use old dev chain for stress tests * update rpc tests * revise polkadotjstests to old dev runtime * Update lib/genesis/test_utils.go Co-authored-by: Quentin McGaw <[email protected]> * Update lib/utils/utils.go Co-authored-by: Quentin McGaw <[email protected]> * Update lib/utils/utils.go Co-authored-by: Quentin McGaw <[email protected]> * Update lib/utils/utils.go Co-authored-by: Quentin McGaw <[email protected]> * Update lib/utils/utils.go Co-authored-by: Quentin McGaw <[email protected]> * Update lib/utils/utils.go Co-authored-by: Quentin McGaw <[email protected]> * remove config and go code from old runtimes * undo new require in go.mod Co-authored-by: Quentin McGaw <[email protected]>
1 parent 49dacc3 commit acea723

21 files changed

+876
-26
lines changed

chain/dev-v3substrate/genesis-spec.json

Lines changed: 316 additions & 0 deletions
Large diffs are not rendered by default.

chain/dev-v3substrate/genesis.json

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

chain/gssmr-v3substrate/genesis-spec.json

Lines changed: 346 additions & 0 deletions
Large diffs are not rendered by default.

chain/gssmr-v3substrate/genesis.json

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

dot/core/service_integration_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"fmt"
1111
"math/big"
1212
"os"
13-
"path/filepath"
1413
"testing"
1514
"time"
1615

@@ -52,7 +51,7 @@ func balanceKey(t *testing.T, pub []byte) (bKey []byte) {
5251

5352
func generateTestValidRemarkTxns(t *testing.T, pubKey []byte, accInfo types.AccountInfo) ([]byte, runtime.Instance) {
5453
t.Helper()
55-
projectRootPath := filepath.Join(utils.GetProjectRootPathTest(t), "chain/gssmr/genesis.json")
54+
projectRootPath := utils.GetGssmrV3SubstrateGenesisRawPathTest(t)
5655
gen, err := genesis.NewGenesisFromJSONRaw(projectRootPath)
5756
require.NoError(t, err)
5857

@@ -409,6 +408,7 @@ func TestHandleChainReorg_WithReorg_Transactions(t *testing.T) {
409408
require.Equal(t, transaction.NewValidTransaction(tx, validity), pending[0])
410409
}
411410

411+
// TODO: add test against latest gssmr runtime
412412
func TestMaintainTransactionPool_EmptyBlock(t *testing.T) {
413413
accountInfo := types.AccountInfo{
414414
Nonce: 0,
@@ -465,6 +465,7 @@ func TestMaintainTransactionPool_EmptyBlock(t *testing.T) {
465465
require.Nil(t, head)
466466
}
467467

468+
// TODO: add test against latest gssmr runtime
468469
func TestMaintainTransactionPool_BlockWithExtrinsics(t *testing.T) {
469470
accountInfo := types.AccountInfo{
470471
Nonce: 0,

dot/sync/chain_processor_integration_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/stretchr/testify/require"
2121
)
2222

23+
// TODO: add test against latest gssmr runtime
2324
func TestChainProcessor_HandleBlockResponse_ValidChain(t *testing.T) {
2425
syncer := newTestSyncer(t)
2526
responder := newTestSyncer(t)
@@ -79,6 +80,7 @@ func TestChainProcessor_HandleBlockResponse_ValidChain(t *testing.T) {
7980
}
8081
}
8182

83+
// TODO: add test against latest gssmr runtime
8284
func TestChainProcessor_HandleBlockResponse_MissingBlocks(t *testing.T) {
8385
syncer := newTestSyncer(t)
8486

@@ -154,6 +156,7 @@ func TestChainProcessor_HandleBlockResponse_NoBlockData(t *testing.T) {
154156
require.Equal(t, ErrNilBlockData, err)
155157
}
156158

159+
// TODO: add test against latest gssmr runtime
157160
func TestChainProcessor_HandleBlockResponse_BlockData(t *testing.T) {
158161
syncer := newTestSyncer(t)
159162

@@ -183,6 +186,7 @@ func TestChainProcessor_HandleBlockResponse_BlockData(t *testing.T) {
183186
}
184187
}
185188

189+
// TODO: add test against latest gssmr runtime
186190
func TestChainProcessor_ExecuteBlock(t *testing.T) {
187191
syncer := newTestSyncer(t)
188192

dot/sync/syncer_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func newTestSyncer(t *testing.T) *Service {
124124
}
125125

126126
func newTestGenesisWithTrieAndHeader(t *testing.T) (*genesis.Genesis, *trie.Trie, *types.Header) {
127-
fp := utils.GetGssmrGenesisRawPathTest(t)
127+
fp := utils.GetGssmrV3SubstrateGenesisRawPathTest(t)
128128
gen, err := genesis.NewGenesisFromJSONRaw(fp)
129129
require.NoError(t, err)
130130

dot/utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
func newTestGenesisFile(t *testing.T, cfg *Config) (filename string) {
2525
t.Helper()
2626

27-
fp := utils.GetGssmrGenesisRawPathTest(t)
27+
fp := utils.GetGssmrV3SubstrateGenesisPathTest(t)
2828
gssmrGen, err := genesis.NewGenesisFromJSON(fp, 0)
2929
require.NoError(t, err)
3030

go.mod

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/ChainSafe/gossamer
22

33
require (
4-
github.com/ChainSafe/chaindb v0.1.5-0.20220322154826-c0d431995732
4+
github.com/ChainSafe/chaindb v0.1.5-0.20220708005902-df45dbc8e840
55
github.com/ChainSafe/go-schnorrkel v1.0.1-0.20220711122024-027d287d27bf
66
github.com/OneOfOne/xxhash v1.2.8
77
github.com/breml/rootcerts v0.2.6
88
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
99
github.com/chyeh/pubip v0.0.0-20170203095919-b7e679cf541c
1010
github.com/cosmos/go-bip39 v1.0.0
1111
github.com/dgraph-io/badger/v2 v2.2007.4
12-
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de
12+
github.com/dgraph-io/ristretto v0.1.0
1313
github.com/disiqueira/gotree v1.0.0
1414
github.com/docker/docker v20.10.17+incompatible
1515
github.com/ethereum/go-ethereum v1.10.21
@@ -69,8 +69,7 @@ require (
6969
github.com/decred/base58 v1.0.3 // indirect
7070
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
7171
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
72-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
73-
github.com/docker/go-units v0.4.0 // indirect
72+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
7473
github.com/dustin/go-humanize v1.0.0 // indirect
7574
github.com/elastic/gosigar v0.12.0 // indirect
7675
github.com/flynn/noise v1.0.0 // indirect
@@ -83,6 +82,7 @@ require (
8382
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
8483
github.com/godbus/dbus/v5 v5.0.3 // indirect
8584
github.com/gogo/protobuf v1.3.2 // indirect
85+
github.com/golang/glog v1.0.0 // indirect
8686
github.com/golang/snappy v0.0.4 // indirect
8787
github.com/google/gopacket v1.1.19 // indirect
8888
github.com/gtank/ristretto255 v0.1.2 // indirect
@@ -125,7 +125,7 @@ require (
125125
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
126126
github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect
127127
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
128-
github.com/mattn/go-colorable v0.1.9 // indirect
128+
github.com/mattn/go-colorable v0.1.12 // indirect
129129
github.com/mattn/go-isatty v0.0.14 // indirect
130130
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
131131
github.com/miekg/dns v1.1.43 // indirect
@@ -189,4 +189,6 @@ require (
189189
lukechampine.com/blake3 v1.1.7 // indirect
190190
)
191191

192+
require github.com/docker/go-units v0.4.0 // indirect
193+
192194
go 1.18

go.sum

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIo
4343
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
4444
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4545
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
46-
github.com/ChainSafe/chaindb v0.1.5-0.20220322154826-c0d431995732 h1:dOdDfWtgfucQHXder8eSItN03JgQzY1V0BiKJgNERnE=
47-
github.com/ChainSafe/chaindb v0.1.5-0.20220322154826-c0d431995732/go.mod h1:P01m9E6xj6Mps1rtf7SurEX9oOcy1jYEyccZQAEw9+4=
46+
github.com/ChainSafe/chaindb v0.1.5-0.20220708005902-df45dbc8e840 h1:qdwel/UNcN1PmrzZG4iTf8/cKAVCas+/RdXq/5NOxps=
47+
github.com/ChainSafe/chaindb v0.1.5-0.20220708005902-df45dbc8e840/go.mod h1:P01m9E6xj6Mps1rtf7SurEX9oOcy1jYEyccZQAEw9+4=
4848
github.com/ChainSafe/go-schnorrkel v1.0.1-0.20220711122024-027d287d27bf h1:S195ZBRu20VgXC1i5nHTR6b4BbTQaMCDuq6tzFQN5zU=
4949
github.com/ChainSafe/go-schnorrkel v1.0.1-0.20220711122024-027d287d27bf/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4=
5050
github.com/ChainSafe/log15 v1.0.0 h1:vRDVtWtVwIH5uSCBvgTTZh6FA58UBJ6+QiiypaZfBf8=
@@ -188,11 +188,13 @@ github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdw
188188
github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk=
189189
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
190190
github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
191-
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA=
192191
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
192+
github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI=
193+
github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug=
193194
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
194-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
195195
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
196+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
197+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
196198
github.com/disiqueira/gotree v1.0.0 h1:en5wk87n7/Jyk6gVME3cx3xN9KmUCstJ1IjHr4Se4To=
197199
github.com/disiqueira/gotree v1.0.0/go.mod h1:7CwL+VWsWAU95DovkdRZAtA7YbtHwGk+tLV/kNi8niU=
198200
github.com/docker/docker v20.10.17+incompatible h1:JYCuMrWaVNophQTOrMMoSwudOVEfcegoZZrleKc1xwE=
@@ -279,6 +281,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
279281
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
280282
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
281283
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
284+
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
285+
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
282286
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
283287
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
284288
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -740,8 +744,9 @@ github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs
740744
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
741745
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
742746
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
743-
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
744747
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
748+
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
749+
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
745750
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
746751
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
747752
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
@@ -1374,6 +1379,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
13741379
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13751380
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13761381
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1382+
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13771383
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13781384
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13791385
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 commit comments

Comments
 (0)