Fix(testnet): Method to fix balance of aurora account#225
Merged
Conversation
joshuajbouw
suggested changes
Aug 11, 2021
Member
Author
|
@joshuajbouw per my description in the PR:
So I don't think we should worry about small details like what should be |
Contributor
|
Ah! so I see. Ok, good point. |
joshuajbouw
approved these changes
Aug 11, 2021
sept-en
reviewed
Aug 11, 2021
artob
added a commit
that referenced
this pull request
Aug 14, 2021
* ERC-20: forbid using invalid NEP141 AccountID for mapping (#179) * Timestamp should be in milliseconds for Ethereum compatibility (#208) * feat(engine): Blockhash definition (#213) * Update etc/state-migration-test/Cargo.lock (#211) * Include cost of access list in intrinsic gas (#219) * Bump tar from 4.4.13 to 4.4.15 in /etc/eth-contracts (#217) * Feat(engine): Relayer payment (#215) * Scheduled lint is supposed to run nightly clippy (#214) * Return actual status of a transaction (#218) * Added parser for Integer types (#183) * Update to latest nightly (#221) * Fix(engine): do not panic when user has insufficient balance to cover gas (#223) * Update lock files (#224) * Method to fix balance of aurora account on testnet (#225) * Use math api host functions on mainnet (#228) * NEP-141 compliance correctness (#202) * Adapt workflows to dockerized runners (#231) * Move block height to the end of hashed data. (#233) * Ensure solidity artifacts are always recompiled (#234) * Prevent test binary from deploying (#237) * Add removal of eth-contracts to `make clean` * Remove deploy_code feature gate Co-authored-by: Dmitry Strokov <dmitry@aurora.dev> Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev> Co-authored-by: Joshua J. Bouw <joshua@aurora.dev> Co-authored-by: Kirill <kirill@aurora.dev> Co-authored-by: Michael Birch <michael@aurora.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Merged
joshuajbouw
pushed a commit
that referenced
this pull request
Aug 17, 2021
This file contains hidden or 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
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.
Background:
Previously we minted and burned bridged ETH in the NEP-141 contract when it became usable in the EVM. However, in #133 we changed that design to instead hold all the ETH currently available in the EVM in the Aurora account on the NEP-141 contract. This change was made because it makes the
ExitToNearlogic much simpler (it is simply a transfer from the Aurora account to the destination account in the NEP-141 contract).However we did not mint tokens to cover the ones that were burned when they entered the EVM prior to #133. This includes the over 12k ETH that is held by the faucet.
Issue:
As a result, the
ExitToNearfunctionality is now broken on testnet because the Aurora account in the NEP-141 contract has run out of tokens. Note: this only impacts testnet because #133 was merged before the eth-connector was deployed to mainnet, so mainnet has always had the updated design.Solution (this PR):
This PR introduces a method for testnet only which mints tokens to the Aurora account in the NEP-141 contract, restoring the invariant which exists with the
ExitToNeardesign change introduced in #133. Namely, this invariant is that the total available amount of ETH (ETH sent to the exit precompile addresses is no longer available) in the EVM is equal to the balance of the Aurora account in the NEP-141 contract. A test is included to show the method works properly.This new method only needs to be called one time on testnet, so after this has happened we can revert this PR to avoid confusion in the future.
To execute the fix:
Ensure that testnet is built with the following command and then deployed on testnet.
Then execute the following command.
near call --accountId aurora aurora balance_evm_and_nep_141 '{}'