-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conversation
7cccae3
to
25cd749
Compare
workspaces/src/worker/impls.rs
Outdated
@@ -77,6 +77,10 @@ where | |||
) -> ImportContractTransaction<'a, 'b> { | |||
self.workspace.import_contract(id, worker) | |||
} | |||
|
|||
async fn fast_forward(&self, delta_height: u64) -> anyhow::Result<()> { |
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.
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
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.
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
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.
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
sounds good then |
Adds the
worker.fast_forward(x)
specific API for simulating producingx
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 afast_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