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

Read from init_data or contract state in scilla_read precompile #1475

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

JamesHinshelwood
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood commented Sep 18, 2024

The scilla_read precompile now reads from either the contract state or the contract's init data when a value is queried.

To achieve this, I have changed the type of a Scilla contract's init_data from String to Vec<ParamValue>. The same data is stored, but we now parse the data on entry so that we can retrieve values easily later.

Also this fixes #1380

@JamesHinshelwood JamesHinshelwood changed the title wip Support reading from init data with scilla read precompile Sep 18, 2024
@JamesHinshelwood JamesHinshelwood force-pushed the scilla-read-init-data branch 6 times, most recently from f7f25d6 to e97fe35 Compare September 20, 2024 17:12
@JamesHinshelwood JamesHinshelwood changed the title Support reading from init data with scilla read precompile Read from init_data or contract state in scilla_read precompile Sep 20, 2024
@JamesHinshelwood JamesHinshelwood marked this pull request as ready for review September 20, 2024 17:13
Copy link
Contributor

@rrw-zilliqa rrw-zilliqa left a comment

Choose a reason for hiding this comment

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

Happy to approve but don't want to auto-merge until you've said your format change was intentional - sorry!

rrw-zilliqa
rrw-zilliqa previously approved these changes Sep 26, 2024
Copy link
Contributor

@rrw-zilliqa rrw-zilliqa 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 to me :-)

@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Sep 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 26, 2024
rrw-zilliqa
rrw-zilliqa previously approved these changes Sep 26, 2024
Copy link
Contributor

@rrw-zilliqa rrw-zilliqa 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 to me :-)

@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Oct 2, 2024
@JamesHinshelwood JamesHinshelwood removed this pull request from the merge queue due to a manual request Oct 2, 2024
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Oct 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 2, 2024
The scilla_read precompile now reads from either the contract
state or the contract's init data when a value is queried.

To achieve this, I have changed the type of a Scilla contract's
`init_data` from `String` to `Vec<ParamValue>`. The same data is
stored, but we now parse the data on entry so that we can retrieve
values easily later.
Copy link
Contributor

@rrw-zilliqa rrw-zilliqa 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 to me :-)

@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Oct 14, 2024
Merged via the queue into main with commit b1f8a03 Oct 14, 2024
5 checks passed
@JamesHinshelwood JamesHinshelwood deleted the scilla-read-init-data branch October 14, 2024 11:31
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.

Event logs values seem to be double encoded
2 participants