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

Merged
merged 16 commits into from
Jan 6, 2025

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
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

@EclesioMeloJunior EclesioMeloJunior merged commit 582582c into feat/parachain Jan 6, 2025
22 checks passed
@EclesioMeloJunior EclesioMeloJunior deleted the eclesio/backing_state_runtime_call branch January 6, 2025 16:03
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