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

Feat: change private methods to admin methods #676

Merged
merged 5 commits into from
Mar 1, 2023

Conversation

hskang9
Copy link
Contributor

@hskang9 hskang9 commented Feb 1, 2023

Description

This PR changes the following 3 Aurora Engine's private methods to admin methods for Aurora Silo and DAO migration:

  • new_eth_connector
  • set_eth_connector_contract_data
  • set_paused_flags

Changing these methods required to make an account to deploy then set owner to be the account to deploy like the updated deployment code. Adding set_owner method in the engine is expected after this PR.

Performance / NEAR gas cost considerations

Performance has not been considered as this is just an access control change. Gas monitoring would be appreciated.

Testing

NEAR Workspace test on testing the methods can be found here.

How should this be reviewed

Verify compiled engine code in the workspace test repo, Check code in the workspace test, run tests in the repo, and consider gas cost optimization on code changes.

Additional information

This is a part of Aurora DAO migration and Silo milestone.

@joshuajbouw
Copy link
Contributor

Fix tests please.

It turns out every private function changed into admin has  failing point where it conflicts with admin checking method.
@hskang9 hskang9 marked this pull request as ready for review February 14, 2023 10:37
@hskang9 hskang9 requested a review from joshuajbouw as a code owner February 14, 2023 10:37
@hskang9 hskang9 requested review from birchmd and aleksuss February 17, 2023 09:28
engine/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@aleksuss aleksuss left a comment

Choose a reason for hiding this comment

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

LGTM, but change the comment in the set_paused_flags function.

@hskang9 hskang9 requested review from aleksuss and birchmd February 20, 2023 06:08
@hskang9
Copy link
Contributor Author

hskang9 commented Feb 23, 2023

@aleksuss @birchmd comment is removed.

@hskang9 hskang9 requested review from birchmd and aleksuss February 24, 2023 10:45
@hskang9
Copy link
Contributor Author

hskang9 commented Feb 24, 2023

@joshuajbouw is admin change delayed as well?

@hskang9
Copy link
Contributor Author

hskang9 commented Mar 1, 2023

@joshuajbouw the code is now ready to be merged.

@joshuajbouw joshuajbouw added this pull request to the merge queue Mar 1, 2023
Merged via the queue into develop with commit 811608b Mar 1, 2023
@joshuajbouw joshuajbouw deleted the feat/admin-method branch March 1, 2023 12:55
@joshuajbouw joshuajbouw mentioned this pull request Apr 5, 2023
birchmd pushed a commit that referenced this pull request Apr 5, 2023
* fix:Include private checking method first on admin method

It turns out every private function changed into admin has  failing point where it conflicts with admin checking method.

* add comments for admin method checker

* fix: set factory_update_address_version as private

* remove unused comment
joshuajbouw added a commit that referenced this pull request Apr 5, 2023
## [2.9.0] 2023-04-05

### Added

- Enabled XCC for mainnet release by [@birchmd]. ([#694])
- Added `set_owner` contract method which sets the owner of the contract
by [@hskang9]. ([#690])
- New variant of submit function `submit_with_args` which accepts
additional arguments along with the transaction such as the max gas
price a user is ready to pay by [@aleksuss]. ([#696])
- Added the ability to create and fund XCC sub-accounts from external
NEAR accounts by [@birchmd]. ([#735])

### Changes

- Replaced `rjson` with `serde_json` by [@aleksuss]. ([#677])
- Changed owner intended contract methods to now require owner or the
contract itself by [@hskang9]. ([#676])

### Fixes

- Fixed nonce incorrectly being incremented on an out of fund failure by
[@joshuajbouw]. ([#671])
- Fixed a check in promise results before executing cross contract calls
(XCC) callbacks by [@birchmd]. ([#693])
- Fixed a reachable panic in `receive_erc20_tokens` by [@0x3bfc].
([#709])
- Fixed a lack of minimum size checks when instantiating a new `EthGas`
object by [@lempire123]. ([#722])
- Fixed a lack of division by 0 checks in `EthGas::Div()` by
[@lempire123]. ([#718])
- Fixed the validation of the return of `exports:storage_remove` by
[@0x3bfc]. ([#712])
- Fixed missing account validations of NEAR account IDs by [@0x3bfc].
([#703])
- Fixed a reachable panic in the `exitToNear` and `exitToEthereum`
precompiles if the input amount is greater than 1^128 when cast from a
`U256` to `u128` by [@0x3bfc]. ([#681])
- Fixed a reachable panic in `modExp` due to arithmetic overflow by
[@0x3bfc]. ([#688])
- Fixed the ability attaching values to Aurora specific precompiles,
this no longer is possible, by [@0x3bfc]. ([#714])
- Fixed a return error if an ecrecover signature length is not exactly
65 by [@0x3bfc]. ([#717])
- Fixed size checks on input array passed to `exitToNear` and
`exitToEthereum` precompiles by [@0x3bfc]. ([#684])
- Fixed missing gas costs in `exitToNear` and `exitToEthereum`
precompiles by [@lempire123]. ([#687])
- Fixed a reachable panic due to out of memory in the `modExp`
precompile by [@0x3bfc]. ([#689])
- Fixed an assurance that the `sender_id` has a balance greater than the
amount in `ft_transfer_call` by [@0x3bfc]. ([#708])
- Fixed returning `0x` when a length cannot be cast as `usize` instead
of returning an error in the `modExp` precompile by [@birchmd]. ([#737])
- Miscellaneous minor fixes by [@0x3bfc]. ([#738])

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Leandro Casuso Montero <leandro.montero@aurora.dev>
Co-authored-by: Michael Birch <michael.birch@aurora.dev>
Co-authored-by: Alexey Lapitsky <lex@realisticgroup.com>
Co-authored-by: Oleksandr Anyshchenko <oleksandr.anyshchenko@aurora.dev>
Co-authored-by: Alexey Lapitsky <alexey.lapitsky@aurora.dev>
Co-authored-by: Hyungsuk Kang <hskang9@gmail.com>
Co-authored-by: Ahmed Ali <ahmedaabdulwahed@gmail.com>
Co-authored-by: lempire123 <61431140+lempire123@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

4 participants