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

feat(runtime): implement ParachainHost_para_backing_state runtime call #4420

Open
wants to merge 12 commits into
base: feat/parachain
Choose a base branch
from

Conversation

EclesioMeloJunior
Copy link
Member

@EclesioMeloJunior EclesioMeloJunior commented Dec 17, 2024

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 current Constraints, which are used by Prospective Parachains to validate incoming candidates, also PendingAvailabilityCandidates which are candidates backed on-chain that is waiting the availability step, they are also used by Prospective 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

Copy link
Contributor

@haikoschol haikoschol left a 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

dot/parachain/types/async_backing.go Outdated Show resolved Hide resolved
lib/runtime/wazero/instance_test.go Outdated Show resolved Hide resolved
dot/parachain/types/types.go Show resolved Hide resolved
dot/parachain/types/async_backing.go Show resolved Hide resolved
dot/parachain/types/types.go Show resolved Hide resolved
dot/parachain/types/async_backing.go Outdated Show resolved Hide resolved
dot/parachain/types/async_backing.go Outdated Show resolved Hide resolved
// The session index of the candidate relay parent.
SessionIndex SessionIndex
// Reserved bytes.
Reserved1 [25]uint8
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

@jimjbrettj jimjbrettj left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants