Closed birchmd closed 2 months ago
Attention: Patch coverage is 93.02326%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 71.60%. Comparing base (
6412f22
) to head (d6822d6
). Report is 4 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
runtime/near-wallet-contract/src/lib.rs | 92.68% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The purpose of this change is to fix a bug in the wallet contract where it was up to the caller to attach enough gas for all the subsequent receipts to be able to complete (the contract was simply passing on unused gas to the callbacks). However, the account can get into a stuck state if the final callback is not executed due to it running out of gas. The PR attaches a fixed amount of gas to all receipts upfront so that they are guaranteed to complete successfully when they are eventually executed by the protocol. An additional test is added to the wallet contract to cover the case where not enough gas is attached.
Since the wallet contracts feature is not yet live on mainnet, we are not making this change to the wallet contract a protocol change as we normally would. Instead we are simply changing the binary the runtime uses for the wallet contract. The old magic bytes hash that was uses to identify the wallet contract is still recognized by the new code so that existing testnet eth-implicit accounts will continue to function.
Note that changing the wallet contract implementation means that new versions of nearcore nodes will not execute some eth-implicit accounts in the same way as old versions of nearcore (breaking change for replaying prior transactions). However since this only impacts testnet and testnet nodes always sync from regularly generated snapshots, this should not be an issue.
To prevent the wallet contract issue from ever appearing in mainnet, this fix should be pulled into the 2.1.1 nearcore release.