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

Aurora Block Hashchain AIP #8

Merged
merged 15 commits into from
Oct 4, 2023
Merged

Aurora Block Hashchain AIP #8

merged 15 commits into from
Oct 4, 2023

Conversation

Casuso
Copy link
Contributor

@Casuso Casuso commented Feb 2, 2023

AIP to introduce an additional block field for Aurora blockchain cryptographic verification.

@Casuso Casuso marked this pull request as ready for review February 7, 2023 23:25
@Casuso Casuso requested review from a team and artob and removed request for a team February 7, 2023 23:25
AIPs/aip-8.md Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
AIPs/aip-8.md Outdated Show resolved Hide resolved
JonathanLogan
JonathanLogan previously approved these changes Apr 3, 2023
@Casuso Casuso requested a review from IAmFets July 6, 2023 17:24
github-merge-queue bot pushed a commit to aurora-is-near/aurora-engine that referenced this pull request Sep 1, 2023
## Description

This PR integrates the hashchain feature into the Aurora Engine contract
(see aurora-is-near/AIPs#8). This change is
fully backwards compatible because by default there is no hashchain
present in the contract state and therefore no hashchain computation is
done.

The method to activate the hashchain is `start_hashchain` requires the
contract to be paused and can only be called by a privileged account (I
chose to use the key manager instead of introducing a new role). These
restrictions are necessary because the hashchain is initialized with a
value based on the Engine's transaction history (to enable validating
Aurora blocks starting from the deployment of the contract).

## Performance / NEAR gas cost considerations

After activating the hashchain there will be a small increase in gas
usage because of the hashchain computation. It's not very much for most
transactions (as seen in the performance regression tests), but the
amount of gas is proportional to the size of the input + output of the
transaction (because we compute a hash from this data).

## Testing

The tests have been changed to enable the hashchain by default.
Therefore all existing tests are running the hashchain code and testing
that the Wasm and Standalone results match (this is important because
the Refiner will be computing hashchain values off-chain using the
Standalone Engine). An additional test has been added for the hashchain
feature itself.

## Additional information

Note: the diff in `contract_methods` is relatively large, but the code
changes are minimal. All that happened is the existing function bodies
were wrapped in `with_hashchain`, which changed the indentation. Viewing
the PR with whitespace changes ignored may make this section easier to
review.
aleksuss pushed a commit to aurora-is-near/aurora-engine that referenced this pull request Sep 25, 2023
## Description

This PR integrates the hashchain feature into the Aurora Engine contract
(see aurora-is-near/AIPs#8). This change is
fully backwards compatible because by default there is no hashchain
present in the contract state and therefore no hashchain computation is
done.

The method to activate the hashchain is `start_hashchain` requires the
contract to be paused and can only be called by a privileged account (I
chose to use the key manager instead of introducing a new role). These
restrictions are necessary because the hashchain is initialized with a
value based on the Engine's transaction history (to enable validating
Aurora blocks starting from the deployment of the contract).

## Performance / NEAR gas cost considerations

After activating the hashchain there will be a small increase in gas
usage because of the hashchain computation. It's not very much for most
transactions (as seen in the performance regression tests), but the
amount of gas is proportional to the size of the input + output of the
transaction (because we compute a hash from this data).

## Testing

The tests have been changed to enable the hashchain by default.
Therefore all existing tests are running the hashchain code and testing
that the Wasm and Standalone results match (this is important because
the Refiner will be computing hashchain values off-chain using the
Standalone Engine). An additional test has been added for the hashchain
feature itself.

## Additional information

Note: the diff in `contract_methods` is relatively large, but the code
changes are minimal. All that happened is the existing function bodies
were wrapped in `with_hashchain`, which changed the indentation. Viewing
the PR with whitespace changes ignored may make this section easier to
review.
birchmd
birchmd previously approved these changes Oct 4, 2023
AIPs/aip-8.md Outdated Show resolved Hide resolved
@birchmd birchmd merged commit b00a96a into master Oct 4, 2023
@birchmd birchmd deleted the aurora_block_hashchain branch October 4, 2023 14:32
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.

5 participants