-
Notifications
You must be signed in to change notification settings - Fork 126
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(runtime): implement ParachainHost_para_backing_state
runtime call
#4420
base: feat/parachain
Are you sure you want to change the base?
feat(runtime): implement ParachainHost_para_backing_state
runtime call
#4420
Conversation
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 nits, good to merge as is
// The session index of the candidate relay parent. | ||
SessionIndex SessionIndex | ||
// Reserved bytes. | ||
Reserved1 [25]uint8 |
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.
Could we give better naming/descriptions to the two differed reserved bytes fields here?
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 the RFC they call them as reserved, that's because they want to be compatible with the V1 as they changed some fields, but in their code they just used reserved
and does not have future plans for them
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, just some minor feedback
Changes
This PR introduces a new runtime call function
ParachainHost_para_backing_state
which retrieves informations about the current backing state for a single parachain, these informations contains the currentConstraints
, which are used byProspective Parachains
to validate incoming candidates, alsoPendingAvailabilityCandidates
which are candidates backed on-chain that is waiting the availability step, they are also used byProspective Parachains
in order to select possible next candidates.Added to
parachaintypes
:Constraints
BackingState
CandidateDescriptorV2
Used the most up to date runtime available
Changed
wazero/Instance
to not hold an instance of the runtime, that is not needed once we bootstrap the runtime from a cached compiled module, also this field was not being used.Tests
go test -timeout 10m -run ^TestInstance_ParachainHostParaBackingState$ github.com/ChainSafe/gossamer/lib/runtime/wazero
Issues
ParachainHost_para_backing_state
runtime call #4416