-
Notifications
You must be signed in to change notification settings - Fork 124
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
feat(prospective-parachains): Implement FragmentChain
#4337
base: feat/parachain
Are you sure you want to change the base?
Conversation
- Added: Candidate Entry - (inclusion_emulator): Added ProspectiveCandidate, Modification error and Fragment Validity error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some types, nits & questions
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a lot of unused/unnecessary methods. Can you please remove unused/unnecessary methods?
Also if you need some logic only in test please consider creating test helper function.
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
dot/parachain/prospective-parachains/fragment-chain/fragment_chain.go
Outdated
Show resolved
Hide resolved
…ssamer into eclesio/fragment-chain-impl
…ssamer into eclesio/fragment-chain-impl
@@ -17,3 +22,90 @@ type AsyncBackingParams struct { | |||
// When async backing is disabled, the only valid value is 0. | |||
AllowedAncestryLen uint32 `scale:"2"` | |||
} | |||
|
|||
// InboundHrmpLimitations constraints on inbound HRMP channels. | |||
type InboundHrmpLimitations struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use this and the below code in any subsystem other than the prospective parachain subsystem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we only use in prospective-parachains pkg, however since this types are a representation of what the runtime uses to validate the constraints I think placing them here is the better approach, given that they are in the same level as CandidateHash
, PersistedValidationData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this package, we keep all the types that are used in multiple subsystems.
CandidateHashm and PersistedValidationData are the types we use in multiple subsystems.
As I can see In Rust implementation, the InboundHrmpLimitations
type is only being used in prospective parachain.
Please move this to prospective parachain package
dot/parachain/types/types.go
Outdated
|
||
// UpgradeRestriction a possible restriction that prevents a parachain | ||
// from performing an upgrade | ||
// TODO: should be scale encoded/decoded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it has already been addressed, can we remove this to-do comment?
Do we need this type in multiple subsystems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type UpgradeRestriction
and its variant Present
is used to validate the candidate, this validation happens only in prospective-parachains
subsystem, this is part of Constraints
type and because of that it should be in the types
pkg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
In this package, we keep all the types used in multiple subsystems.
We will have to move this type, Constraints,
to its correct package where it is used.
If you find any other types that are only needed in prospective parachain but have placed them in the types
package, please move them to the prospective parachain package.
// Constraints on the actions that can be taken by a new parachain block. These | ||
// limitations are implicitly associated with some particular parachain, which should | ||
// be apparent from usage. | ||
type Constraints struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this type to the inclusion simulator file.
This package contains types that we need in multiple subsystems.
Because we will never use this in other subsystems, we only use this in prospective parachain.
Move other types you added to this file that are not used in multiple subsystems.
@@ -17,3 +22,90 @@ type AsyncBackingParams struct { | |||
// When async backing is disabled, the only valid value is 0. | |||
AllowedAncestryLen uint32 `scale:"2"` | |||
} | |||
|
|||
// InboundHrmpLimitations constraints on inbound HRMP channels. | |||
type InboundHrmpLimitations struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this package, we keep all the types that are used in multiple subsystems.
CandidateHashm and PersistedValidationData are the types we use in multiple subsystems.
As I can see In Rust implementation, the InboundHrmpLimitations
type is only being used in prospective parachain.
Please move this to prospective parachain package
dot/parachain/types/types.go
Outdated
|
||
// UpgradeRestriction a possible restriction that prevents a parachain | ||
// from performing an upgrade | ||
// TODO: should be scale encoded/decoded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
In this package, we keep all the types used in multiple subsystems.
We will have to move this type, Constraints,
to its correct package where it is used.
If you find any other types that are only needed in prospective parachain but have placed them in the types
package, please move them to the prospective parachain package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes.
You can merge after addressing the comments.
|
||
// UpgradeRestriction a possible restriction that prevents a parachain | ||
// from performing an upgrade | ||
type UpgradeRestriction struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write the unit test to ensure we are getting the correct encoding/decoding.
Changes
prospective-parachains
subsystems in order to keep the best backable chain of parachain blocksTests
Tests coverage from Polkadot-SDK
go test -timeout 10m github.com/ChainSafe/gossamer/dot/parachain/prospective-parachains/fragment-chain
Issues