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

Introduced parachain candidate validation #3249

Merged
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
eb87ff4
Introduced parachain candidate validation
kishansagathiya May 9, 2023
cd0a656
make lint and make license
kishansagathiya May 9, 2023
0e9ac95
fixed test:wq
kishansagathiya May 9, 2023
2e84116
feat/scale: add `BitVec` (#3253)
kanishkatn May 29, 2023
e9ec1de
feat(erasure_coding): introduce erasure coding for PoV Distributor (#…
edwardmack Jun 8, 2023
cb8a35e
Fix(lint): fixes a lint issue in bitvec-test (#3306)
kanishkatn Jun 9, 2023
e212d48
feat(parachain): add types (#3297)
kanishkatn Jun 15, 2023
dcc31f1
feat(parachain): Add StatementDistributionMessage varingDataType (#3316)
axaysagathiya Jun 20, 2023
29ee139
feat/runtime: Add few parachain runtime calls (#3241)
kanishkatn Jun 21, 2023
11eaf7c
feat(parachain): Create struct for Approval Distribution Message (#3326)
edwardmack Jun 21, 2023
6238983
chore(parachain): improve comments of statement and statement distrib…
axaysagathiya Jun 23, 2023
222e030
feat(parachain): Add CollationProtocol VaryingDataType (#3337)
axaysagathiya Jun 26, 2023
415bcdd
feat(parachain): Implement request and response message for /req_stat…
axaysagathiya Jul 6, 2023
7d8053d
feat(lib/parachain): Implement request and response message for /req_…
axaysagathiya Jul 6, 2023
838ae5f
fix(lib/erasure): Move test assertion to non-error condition (#3371)
edwardmack Jul 7, 2023
0ede93b
feat(lib/parachain): Implement request and response message for /req_…
axaysagathiya Jul 7, 2023
d4ba1fe
feat(lib/parachain): Implement request and response message for /req_…
axaysagathiya Jul 7, 2023
b1757f5
chore(lib/parachain): add tests to decode varying data types regardin…
axaysagathiya Jul 7, 2023
a4873fd
chore(lib/parachain): remove pov byte array and use pov struct (#3375)
axaysagathiya Jul 7, 2023
1699702
feat(lib/parachain): Implement request and response message for /req_…
axaysagathiya Jul 10, 2023
30f371d
feat(lib/parachain): added parachain service and registering protocol…
kishansagathiya Jul 11, 2023
3082b79
Implemented extra parachain host runtime API calls (#3237)
kishansagathiya Jul 27, 2023
3807fc2
Merge branch 'feat/parachain' into kishan/feat/parachain-candidate-va…
kishansagathiya Jul 31, 2023
a7e4b0a
removed lib/parachains for lib/parachain
kishansagathiya Jul 31, 2023
b07e12b
fixing a test and lint
kishansagathiya Jul 31, 2023
b37f560
fix mock
kishansagathiya Jul 31, 2023
f8e1835
addressed reviews
kishansagathiya Aug 1, 2023
0475faa
rename
kishansagathiya Aug 1, 2023
254e329
make lint fix
kishansagathiya Aug 1, 2023
a04bc30
more fix
kishansagathiya Aug 1, 2023
e2f069d
Update lib/parachain/candidate_validation.go
kishansagathiya Aug 1, 2023
a514a9f
more reviews
kishansagathiya Aug 2, 2023
93c350a
Merge branch 'kishan/feat/parachain-candidate-validation' of github.c…
kishansagathiya Aug 2, 2023
c5ed819
Merge branch 'feat/parachain' into kishan/feat/parachain-candidate-va…
kishansagathiya Aug 4, 2023
a255619
addressed reviews
kishansagathiya Aug 4, 2023
73a4b62
moved parachain runtime code to its own package
kishansagathiya Aug 4, 2023
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
152 changes: 152 additions & 0 deletions dot/core/mock_runtime_instance_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dot/mock_node_builder_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dot/network/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const (
blockAnnounceMsgType MessageType = iota + 3
transactionMsgType
ConsensusMsgType
CollationMsgType
ValidationMsgType
)

// Message must be implemented by all network messages
Expand Down
8 changes: 8 additions & 0 deletions dot/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/parachain"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/services"
"github.com/ChainSafe/gossamer/lib/utils"
Expand Down Expand Up @@ -63,6 +64,7 @@ type nodeBuilderIface interface {
dh *digest.Handler) (*core.Service, error)
createGRANDPAService(config *cfg.Config, st *state.Service, ks KeyStore,
net *network.Service, telemetryMailer Telemetry) (*grandpa.Service, error)
createParachainHostService(net *network.Service, genesishHash common.Hash) (*parachain.Service, error)
newSyncService(config *cfg.Config, st *state.Service, finalityGadget BlockJustificationVerifier,
verifier *babe.VerificationManager, cs *core.Service, net *network.Service,
telemetryMailer Telemetry) (*dotsync.Service, error)
Expand Down Expand Up @@ -363,6 +365,12 @@ func newNode(config *cfg.Config,
}
nodeSrvcs = append(nodeSrvcs, fg)

phs, err := builder.createParachainHostService(networkSrvc, stateSrvc.Block.GenesisHash())
if err != nil {
return nil, err
}
nodeSrvcs = append(nodeSrvcs, phs)

syncer, err := builder.newSyncService(config, stateSrvc, fg, ver, coreSrvc, networkSrvc, telemetryMailer)
if err != nil {
return nil, err
Expand Down
8 changes: 7 additions & 1 deletion dot/node_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/parachain"
"github.com/ChainSafe/gossamer/lib/runtime"
wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero"
"github.com/ChainSafe/gossamer/lib/trie"
Expand Down Expand Up @@ -86,7 +87,7 @@ func TestNewNode(t *testing.T) {
assert.NoError(t, err)

mockServiceRegistry := NewMockServiceRegisterer(ctrl)
mockServiceRegistry.EXPECT().RegisterService(gomock.Any()).Times(8)
mockServiceRegistry.EXPECT().RegisterService(gomock.Any()).Times(9)

m := NewMocknodeBuilderIface(ctrl)
m.EXPECT().isNodeInitialised(initConfig.BasePath).Return(nil)
Expand Down Expand Up @@ -120,6 +121,9 @@ func TestNewNode(t *testing.T) {
return stateSrvc, nil
})

phs, err := parachain.NewService(testNetworkService, common.Hash{})
require.NoError(t, err)

m.EXPECT().createRuntimeStorage(gomock.AssignableToTypeOf(&state.Service{})).Return(&runtime.
NodeStorage{}, nil)
m.EXPECT().loadRuntime(initConfig, &runtime.NodeStorage{}, gomock.AssignableToTypeOf(&state.Service{}),
Expand Down Expand Up @@ -150,6 +154,8 @@ func TestNewNode(t *testing.T) {
})
m.EXPECT().createNetworkService(initConfig, gomock.AssignableToTypeOf(&state.Service{}),
gomock.AssignableToTypeOf(&telemetry.Mailer{})).Return(testNetworkService, nil)
m.EXPECT().createParachainHostService(gomock.AssignableToTypeOf(&network.Service{}),
gomock.AssignableToTypeOf(common.Hash{})).Return(phs, nil)

got, err := newNode(initConfig, ks, m, mockServiceRegistry)
assert.NoError(t, err)
Expand Down
6 changes: 6 additions & 0 deletions dot/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/ChainSafe/gossamer/lib/crypto/sr25519"
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/parachain"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero"
Expand Down Expand Up @@ -472,6 +473,11 @@ func (nodeBuilder) createGRANDPAService(config *cfg.Config, st *state.Service, k
return grandpa.NewService(gsCfg)
}

func (nodeBuilder) createParachainHostService(net *network.Service, genesisHash common.Hash) (
*parachain.Service, error) {
return parachain.NewService(net, genesisHash)
}

func (nodeBuilder) createBlockVerifier(st *state.Service) *babe.VerificationManager {
return babe.NewVerificationManager(st.Block, st.Slot, st.Epoch)
}
Expand Down
Loading
Loading