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: add fast-forwarding #73

Merged
merged 7 commits into from
Apr 4, 2022
Merged

feat: add fast-forwarding #73

merged 7 commits into from
Apr 4, 2022

Conversation

ChaoticTempest
Copy link
Member

@ChaoticTempest ChaoticTempest commented Feb 9, 2022

Adds the worker.fast_forward(x) specific API for simulating producing x number of blocks on the sandbox node. Also adds a simple example for fast forwarding and grabbing time specific data related to how many blocks have been produced before and after a fast_forward request.

Mainly opening this one up for comments so we can review this one sooner than later, and will point to the specific nearcore version once near/nearcore#6211 merges

workspaces/Cargo.toml Outdated Show resolved Hide resolved
@austinabell austinabell mentioned this pull request Mar 10, 2022
4 tasks
@ChaoticTempest ChaoticTempest marked this pull request as ready for review March 25, 2022 00:19
workspaces/src/network/mod.rs Outdated Show resolved Hide resolved
@@ -77,6 +77,10 @@ where
) -> ImportContractTransaction<'a, 'b> {
self.workspace.import_contract(id, worker)
}

async fn fast_forward(&self, delta_height: u64) -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noting that adding this function to StatePatcher blurs that naming meaning. These things seem sandbox specific so not sure why the trait is needed yet

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, yeah let's just get rid of the StatePatcher trait and expose Sandbox so people can just reference Worker<Sandbox> in their functions directly then. It's gonna be very sandbox specific behavior so might as well go that route

Copy link
Contributor

@austinabell austinabell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't notice that you moved the logic similar to #102 for removing StatePatcher. I'd say pull this one in first and then I can resolve conflicts on mine

@ChaoticTempest
Copy link
Member Author

sounds good then

@ChaoticTempest ChaoticTempest merged commit f4458f2 into main Apr 4, 2022
@ChaoticTempest ChaoticTempest deleted the feat/fast-forward branch April 4, 2022 20:09
@frol frol mentioned this pull request Oct 4, 2023
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.

3 participants