-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extend compatibility with Aurora EVM #11
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s-near/aurora-eth-connector into feat/extend-engin-compatibility
birchmd
suggested changes
Jan 19, 2023
aleksuss
reviewed
Jan 19, 2023
birchmd
approved these changes
Jan 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice job
.transact() | ||
.await?; | ||
assert!(res.is_success()); | ||
contract.set_and_check_access_right(user_acc.id()).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on reducing code duplication! 🚀
aleksuss
approved these changes
Jan 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current
aurora-eth-connector
implementation is based on the NEAR contract standards library. The specificity of this implementation is that the sender ispredecessor_account id
. However, when interacting with the Aurora EVM, an obvious problem arises - in this case, the sender will always be the Aurora contract. This PR solves this problem.Solution
In order for the Aurora contract user who initiated the request to act as the sender, additional functions are introduced:
engine_ft_transfer
engine_ft_transfer_call
engine_storage_deposit
engine_storage_deposit
engine_storage_unregister
These features are compatible with the corresponding features of NEP-141. However, they have a number of additional features:
sender_id
- which must contain the initiator of the transaction, which on the Aurora EVM side is contained inpredecessor_account_id
.predecessor_account_id
parameter, instead, the incoming function parametersender_id
.access_rights
check that restricts access to these functions to only those users and contracts that are allowed access.Breaking changes
No breaking changes
Gas costs
INCREASED: ~30%. Gas cost measuring in migration: 1520 TGas to 1981 TGas for accounts migrations.
And for migration total gas cost: 11852 TGas -> 12310 TGas.
Gas cost changes reason
after dependency updates
cargo update
, also after version changes:ethabi 18.0
- updated because it needed inaurora-engine-types
aurora-engine-types - latest develop
Tests
The new functionality is covered with additional tests covering every logical aspect of the new functionality.
What should be changed in Aurora EVM
All functions that interact with the
aurora-eth-connector
contract that are relevant to NEP-141:ft_transfer
ft_transfer_call
storage_deposit
storage_deposit
storage_unregister
must be changed to call the new functions in
aurora-eth-connector
with the appropriate options.Aurora EVM tests
Aurora EVM must be modified to accommodate the new features.