Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Allow sharing ReferenceCounter between engines #340

Merged
merged 1 commit into from
Jul 5, 2020

Conversation

erikzhang
Copy link
Member

No description provided.

@ixje
Copy link
Contributor

ixje commented Jul 3, 2020

are we going to try and run engines in parallel or?

@erikzhang
Copy link
Member Author

I want to run an engine inside another engine. In this way, you can create an isolated environment from the contract, execute another contract, and observe whether it succeeds or fails.

@erikzhang
Copy link
Member Author

For example, contract A and B.

A calls to B.

If B fails, then A will also fail, and all state changes must be rolled back.

If there is a mechanism that allows A to create an isolated environment to execute B, then the execution state of B will be captured by A. Even if B fails to execute, A can capture it and continue execution.

@ixje
Copy link
Contributor

ixje commented Jul 3, 2020

Thanks for giving the background information regarding this change 👍

@vncoelho
Copy link
Member

vncoelho commented Jul 3, 2020

I want to run an engine inside another engine. In this way, you can create an isolated environment from the contract, execute another contract, and observe whether it succeeds or fails.

@erikzhang, this was our intention when we proposed op_eval. To isolate it in another engine.
We still have a need for this requirement, we need it for some of our projects, not still sure if callbacks will satisfy.

Copy link
Contributor

@igormcoelho igormcoelho left a comment

Choose a reason for hiding this comment

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

Just left some comments over possible surpassing max limits.


protected ExecutionEngine(ReferenceCounter referenceCounter)
{
this.ReferenceCounter = referenceCounter;
Copy link
Contributor

Choose a reason for hiding this comment

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

So, my previous question comes here: do we need to ensure that "globally" a nesting access (call X -> call Y -> call Z -> ...) in such a way that it surpasses limits for array counts, etc, in a dangerous way?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean? This change is to ensure that it won't surpass the limits.

@erikzhang erikzhang merged commit 87d7675 into master Jul 5, 2020
@erikzhang erikzhang deleted the share-reference-counter branch July 5, 2020 07:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants