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

Chore(standalone): reuse contract_methods logic #830

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

birchmd
Copy link
Member

@birchmd birchmd commented Aug 28, 2023

Description

This is a follow-up PR from #827 . In this PR we make the standalone engine reuse the logic that was isolated from the contract in that PR. One key thing to notice about this change is the raw bytes that would be passed to the on-chain contract as input are now also passed to the standalone engine. This will help enable the hashchain to work identically both on-chain and off-chain. Additionally, the output from all methods is captured in the IO instance. We do not yet make use of this, but in a follow-up PR this will also be a necessary feature to ensure the hashchain works properly.

Performance / NEAR gas cost considerations

N/A standalone engine changes only

Testing

Existing tests.

Additional information

Note: the TransactionKind::raw_bytes method is only used in tests and for backwards compatibility. After a full re-index of the Borealis state (which will be needed to compute the hashchain history anyway) this method will not be used in production (i.e. we are not de-serializing + re-serializing the input on every transaction, that would be very inefficient).

@birchmd birchmd added the A-standalone Area: the standalone engine EVM label Aug 28, 2023
@aleksuss aleksuss requested a review from mrLSD August 28, 2023 16:00
@birchmd birchmd added this pull request to the merge queue Aug 28, 2023
Merged via the queue into develop with commit 2d3a4d8 Aug 28, 2023
20 checks passed
@birchmd birchmd deleted the chore/birchmd/standalone-refactor branch August 28, 2023 17:53
aleksuss pushed a commit that referenced this pull request Sep 25, 2023
## Description

This is a follow-up PR from #827 . In this PR we make the standalone
engine reuse the logic that was isolated from the contract in that PR.
One key thing to notice about this change is the raw bytes that would be
passed to the on-chain contract as input are now also passed to the
standalone engine. This will help enable the hashchain to work
identically both on-chain and off-chain. Additionally, the output from
all methods is captured in the IO instance. We do not yet make use of
this, but in a follow-up PR this will also be a necessary feature to
ensure the hashchain works properly.

## Performance / NEAR gas cost considerations

N/A standalone engine changes only

## Testing

Existing tests.

## Additional information

Note: the `TransactionKind::raw_bytes` method is only used in tests and
for backwards compatibility. After a full re-index of the Borealis state
(which will be needed to compute the hashchain history anyway) this
method will not be used in production (i.e. we are not de-serializing +
re-serializing the input on every transaction, that would be very
inefficient).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-standalone Area: the standalone engine EVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants