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

Sync calls #227

Merged
merged 54 commits into from
Feb 11, 2022
Merged

Sync calls #227

merged 54 commits into from
Feb 11, 2022

Conversation

abizjak
Copy link
Contributor

@abizjak abizjak commented Dec 23, 2021

Purpose

Introduce V1 version of smart contracts that supports synchronous calls.

Implements part of #236

Changes

  1. Revise module and contract instance type to be versioned by the Wasm module version. The version of the module determines the version of the contract instance. For simplicity and maintainability these are not parametrized by protocol version. The scheduler is the gatekeeper that disallows V1 modules and instances in protocol versions <= 3. This was not possible for PersistentInstance since its BlobStorable implementation did not have sufficient versioning. This is added in protocol versions 4 and up.
  2. Introduce V1 contract execution engine bindings and implement handling of V1 contracts in the scheduler.
  3. Add an InvokeContract API endpoint and implement invoking a contract at the end of a given block. Implementing this necessitated some minor refactoring of the environment/scheduler abstractions. In particular removing txHash from the TransactionMonad state. It is unclear why that was there.

Depends on

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@abizjak abizjak force-pushed the sync-calls branch 4 times, most recently from 1882f7e to 3119bfc Compare December 27, 2021 09:01
@abizjak abizjak requested review from Bargsteen and td202 January 17, 2022 11:43
Copy link
Contributor

@MilkywayPirate MilkywayPirate left a comment

Choose a reason for hiding this comment

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

First leg.

Copy link
Contributor

@MilkywayPirate MilkywayPirate left a comment

Choose a reason for hiding this comment

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

Looks good

docs/contracts.md Show resolved Hide resolved
docs/contracts.md Outdated Show resolved Hide resolved
docs/contracts.md Show resolved Hide resolved
Copy link
Contributor

@Bargsteen Bargsteen left a comment

Choose a reason for hiding this comment

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

Great work!

@abizjak abizjak mentioned this pull request Feb 6, 2022
8 tasks
Copy link
Contributor

@Bargsteen Bargsteen left a comment

Choose a reason for hiding this comment

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

LGTM. 😊

docs/grpc.md Show resolved Hide resolved
docs/grpc.md Outdated Show resolved Hide resolved
@abizjak abizjak merged commit 600a597 into main Feb 11, 2022
@abizjak abizjak deleted the sync-calls branch February 11, 2022 16:42
@abizjak abizjak linked an issue Feb 19, 2022 that may be closed by this pull request
7 tasks
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.

Synchronous contract calls: Node support
4 participants