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: add possibility to use fixed gas cost (silo) #746

Merged
merged 47 commits into from
Oct 11, 2023

Conversation

aleksuss
Copy link
Member

@aleksuss aleksuss commented Apr 25, 2023

Description

The PR adds the possibility to set fixed gas costs per EVM transaction. The feature could be switched on by calling the transaction set_fixed_gas_cost. Also, four types of white lists have been added for applying restrictions to deploy code and submit transactions.

Additions: The PR introduces a new feature: ext-connector, and two additional profiles: mainnet-silo and testnet-silo. The smart contract built with one of these profiles implies the usage of an external eth-connector.

Performance / NEAR gas cost considerations

There are insignificant gas cost increases. That is because we read from the storage fixed gas cost in the execution of the submit method.

Testing

The unit and integration tests which test the new logic have been added.

How should this be reviewed

Additional information

Copy link
Member

@birchmd birchmd left a comment

Choose a reason for hiding this comment

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

Very clean code, nice job!

engine-types/src/lib.rs Show resolved Hide resolved
engine/src/silo/whitelist.rs Outdated Show resolved Hide resolved
engine-tests/src/tests/silo.rs Outdated Show resolved Hide resolved
engine-tests/src/test_utils/mod.rs Outdated Show resolved Hide resolved
engine-tests/src/tests/promise_results_precompile.rs Outdated Show resolved Hide resolved
engine/src/engine.rs Show resolved Hide resolved
engine/src/engine.rs Outdated Show resolved Hide resolved
engine/src/silo/whitelist.rs Outdated Show resolved Hide resolved
engine/src/silo/whitelist.rs Outdated Show resolved Hide resolved
engine/src/silo/whitelist.rs Outdated Show resolved Hide resolved
engine/src/silo/whitelist.rs Outdated Show resolved Hide resolved
.github/workflows/lints.yml Outdated Show resolved Hide resolved
engine/src/silo/mod.rs Outdated Show resolved Hide resolved
engine/src/silo/mod.rs Outdated Show resolved Hide resolved
## Description

The PR just updates release notes in the develop branch and bumps
`aurora-engine` version.
# Conflicts:
#	CHANGES.md
#	Cargo.toml
#	engine-hashchain/src/bloom.rs
#	engine-hashchain/src/hashchain.rs
#	engine-hashchain/src/lib.rs
#	engine-standalone-storage/src/sync/mod.rs
#	engine-standalone-storage/src/sync/types.rs
#	engine-tests/src/tests/one_inch.rs
#	engine-tests/src/tests/promise_results_precompile.rs
#	engine-tests/src/utils/mod.rs
#	engine-tests/src/utils/standalone/mod.rs
#	engine-types/src/storage.rs
#	engine/src/lib.rs
# Conflicts:
#	engine-precompiles/src/native.rs
#	engine-tests/src/tests/erc20_connector.rs
#	engine-tests/src/utils/workspace.rs
@aleksuss aleksuss force-pushed the feat/aleksuss/silo branch 2 times, most recently from 26fb92f to fcf4435 Compare October 3, 2023 11:41
@aleksuss aleksuss requested review from mrLSD and birchmd October 3, 2023 13:08
@aleksuss aleksuss requested a review from karim-en October 3, 2023 13:14
engine-precompiles/src/native.rs Show resolved Hide resolved
engine-standalone-storage/src/relayer_db/mod.rs Outdated Show resolved Hide resolved
engine-standalone-storage/src/sync/types.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@karim-en karim-en left a comment

Choose a reason for hiding this comment

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

LGTM! just have some minor questions.

engine-tests/src/utils/workspace.rs Show resolved Hide resolved
engine-standalone-storage/src/sync/mod.rs Show resolved Hide resolved
engine-precompiles/src/native.rs Show resolved Hide resolved
## Description

The PR adds a possibility to mirror previously deployed ERC-20 contracts
on the main Aurora contract. The transaction `mirror_erc20_token` is
allowed in the Silo mode only.

`mirror_erc20_token` accepts parameters serialised with borsh.
`get(set)_erc20_metadata` accepts parameters serialised with JSON.

## Performance / NEAR gas cost considerations

There are no changes in the performance/gas consumption.

## Testing

The corresponding test has been added.
# Conflicts:
#	engine-tests/src/tests/sanity.rs
#	engine-tests/src/utils/mod.rs
@aleksuss aleksuss added this pull request to the merge queue Oct 11, 2023
Merged via the queue into develop with commit eccae2f Oct 11, 2023
19 checks passed
@aleksuss aleksuss deleted the feat/aleksuss/silo branch October 11, 2023 17:31
aleksuss added a commit that referenced this pull request Oct 17, 2023
## Description

The PR adds the possibility to set fixed gas costs per EVM transaction.
The feature could be switched on by calling the transaction
`set_fixed_gas_cost`. Also, four types of white lists have been added
for applying restrictions to deploy code and submit transactions.

**Additions**: The PR introduces a new feature: `ext-connector`, and two
additional profiles: `mainnet-silo` and `testnet-silo`. The smart
contract built with one of these profiles implies the usage of an
external eth-connector.

## Performance / NEAR gas cost considerations

There are insignificant gas cost increases. That is because we read from
the storage fixed gas cost in the execution of the `submit` method.

## Testing

The unit and integration tests which test the new logic have been added.

## How should this be reviewed

<!--
Include any recommendations of areas to be careful of to ensure that the
reviewers use extra attention.
-->

## Additional information

<!--
Include any additional information which you think should be in this PR,
such
as prior arts, future extensions, unresolved problems, or a TODO list
which
should be followed up.
-->

---------

Co-authored-by: Karim <karim@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev>
Co-authored-by: Michael Birch <michael.birch@aurora.dev>
@aleksuss aleksuss mentioned this pull request Oct 17, 2023
aleksuss added a commit that referenced this pull request Oct 17, 2023
## Release 3.2.0

### Changes

- Changed structure `SetEthConnectorContractAccountArgs` for setting eth
connector account. It was extended with
additional field: `withdraw_serialize_type` for defining serialization
type for withdraw arguments by [@aleksuss]. ([#834])

- Updated rocksdb up to 0.21.0 by [@aleksuss]. ([#840])

### Additions

- Added a possibility of mirroring deployed ERC-20 contracts in the main
Aurora contract in Silo mode by [@aleksuss]. ([#844])

- Allow to initialize hashchain directly with the `new` method by
[@birchmd]. ([#846])

- Added a silo logic which allows to set fixed gas costs per transaction
by [@aleksuss]. ([#746])

- Added a new type of transaction which allows to add full access key
into account of the smart contract by [@aleksuss]. ([#847])

[#746]: #746
[#834]: #834
[#840]: #840
[#844]: #844
[#846]: #846
[#847]: #847

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: i-fix-typos <146758284+i-fix-typos@users.noreply.github.com>
Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev>
Co-authored-by: Michael Birch <michael.birch@aurora.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Karim <karim@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
Co-authored-by: ForwardSlashBack <142098649+ForwardSlashBack@users.noreply.github.com>
aleksuss added a commit that referenced this pull request Oct 17, 2023
## Release 3.2.0

### Changes

- Changed structure `SetEthConnectorContractAccountArgs` for setting eth
connector account. It was extended with
additional field: `withdraw_serialize_type` for defining serialization
type for withdraw arguments by [@aleksuss]. ([#834])

- Updated rocksdb up to 0.21.0 by [@aleksuss]. ([#840])

### Additions

- Added a possibility of mirroring deployed ERC-20 contracts in the main
Aurora contract in Silo mode by [@aleksuss]. ([#844])

- Allow to initialize hashchain directly with the `new` method by
[@birchmd]. ([#846])

- Added a silo logic which allows to set fixed gas costs per transaction
by [@aleksuss]. ([#746])

- Added a new type of transaction which allows to add full access key
into account of the smart contract by [@aleksuss]. ([#847])

[#746]: #746
[#834]: #834
[#840]: #840
[#844]: #844
[#846]: #846
[#847]: #847

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: i-fix-typos <146758284+i-fix-typos@users.noreply.github.com>
Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev>
Co-authored-by: Michael Birch <michael.birch@aurora.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Karim <karim@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
Co-authored-by: ForwardSlashBack <142098649+ForwardSlashBack@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.

None yet

7 participants