-
Notifications
You must be signed in to change notification settings - Fork 3
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
Restoring Sandbox Host Functions for Node Synchronization in Full Mode #478
Draft
Aideepakchaudhary
wants to merge
17
commits into
feat/polkadot-stable2409
Choose a base branch
from
feat/integrating-host-function
base: feat/polkadot-stable2409
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Restoring Sandbox Host Functions for Node Synchronization in Full Mode #478
Aideepakchaudhary
wants to merge
17
commits into
feat/polkadot-stable2409
from
feat/integrating-host-function
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR restores the sandbox host functions that were removed in Polkadot version v0.9.35 to address the node synchronization issue in full mode.
Changes Introduced in this PR:
Added new files to reinstate the functionality of sandbox host functions:
freeing_bump.rs
implements a freeing-bump allocator which manages heap memory as acontinuous linear space.
FunctionExecutor
like Sandbox trait implementation.Sandbox functions are now called directly from node/client/src/lib.rs to ensure seamless integration.
Notes:
Dependency on an Older Version of wasmi
The implementation currently uses version 0.13 of the wasmi library. This decision was made because the recent updates to wasmi involved a complete reimplementation, which resulted in the removal of several functions and types required for sandbox functionality.
Issue with Host Function Calls
When attempting to call the host function implementation here, the call (self.sandbox()) traverses through the
sp-runtime_interface
and attempts to access the sandbox function in thewasm_interface
module. However, this function has been removed from Polkadot SDK, leading to the current challenge.Types of Changes
Please select the branch type you are merging and fill in the relevant template.
Fix or Feature
Types of Changes
Migrations and Hooks
on_initialize
on_finalize
Checklist for Fix or Feature
spec_version
has been incremented.network-relayer
's events have been updated according to the blockchain events if applicable.Checklist for Hotfix
spec_version
has been incremented.dev
has been created.staging
has been created.network-relayer
's events have been updated according to the blockchain events if applicable.Checklist for Release