Skip to content

Commit

Permalink
Release 3.4.0 (#874)
Browse files Browse the repository at this point in the history
## [3.4.0] 2023-11-28

### Additions

- Added a possibility to pass initialize arguments in json format to the
`new` transaction by [@aleksuss]. ([#871])
- The `SubmitResult` was made available for `ft_on_transfer`
transactions in the standalone engine by [@birchmd]. ([#869])
- The order of producing the exit precompile and XCC promises has been
changed to sequential by [@birchmd]. ([#868])

### Changes

- Removed the code hidden behind the feature that isn't used anymore by
[@joshuajbouw]. ([#870])
- The logic of unwrapping wNEAR has been changed to the Bridge's native
by [@birchmd]. ([#867])
- Bumped the `near-workspaces` to 0.9 by [@aleksuss]. ([#862])

### Fixes

- Add a method for upgrading XCC router contract by [@birchmd]. ([#866])
- Fixed a potential panic in the `ExitToNear` precompile by
[@guidovranken]. ([#865])
- Fixed a behaviour when the `ft_transfer` could occur before the
`near_withdraw` by [@birchmd]. ([#864])
- Fixed correctness of reproducing the NEAR runtime random value in the
standalone engine by [@birchmd]. ([#863])

[#862]: #862
[#863]: #863
[#864]: #864
[#865]: #865
[#866]: #866
[#867]: #867
[#868]: #868
[#869]: #869
[#870]: #870
[#871]: #871

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Birch <[email protected]>
Co-authored-by: Guido Vranken <[email protected]>
Co-authored-by: Joshua J. Bouw <[email protected]>
  • Loading branch information
5 people committed Nov 28, 2023
1 parent 9963486 commit 4e67385
Show file tree
Hide file tree
Showing 57 changed files with 1,444 additions and 650 deletions.
45 changes: 36 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.4.0] 2023-11-28

### Additions

- Added a possibility to pass initialize arguments in json format to the `new` transaction by [@aleksuss]. ([#871])
- The `SubmitResult` was made available for `ft_on_transfer` transactions in the standalone engine by [@birchmd]. ([#869])
- The order of producing the exit precompile and XCC promises has been changed to sequential by [@birchmd]. ([#868])

### Changes

- Removed the code hidden behind the feature that isn't used anymore by [@joshuajbouw]. ([#870])
- The logic of unwrapping wNEAR has been changed to the Bridge's native by [@birchmd]. ([#867])
- Bumped the `near-workspaces` to 0.9 by [@aleksuss]. ([#862])

### Fixes

- Add a method for upgrading XCC router contract by [@birchmd]. ([#866])
- Fixed a potential panic in the `ExitToNear` precompile by [@guidovranken]. ([#865])
- Fixed a behaviour when the `ft_transfer` could occur before the `near_withdraw` by [@birchmd]. ([#864])
- Fixed correctness of reproducing the NEAR runtime random value in the standalone engine by [@birchmd]. ([#863])

[#862]: https://github.com/aurora-is-near/aurora-engine/pull/862
[#863]: https://github.com/aurora-is-near/aurora-engine/pull/863
[#864]: https://github.com/aurora-is-near/aurora-engine/pull/864
[#865]: https://github.com/aurora-is-near/aurora-engine/pull/865
[#866]: https://github.com/aurora-is-near/aurora-engine/pull/866
[#867]: https://github.com/aurora-is-near/aurora-engine/pull/867
[#868]: https://github.com/aurora-is-near/aurora-engine/pull/868
[#869]: https://github.com/aurora-is-near/aurora-engine/pull/869
[#870]: https://github.com/aurora-is-near/aurora-engine/pull/870
[#871]: https://github.com/aurora-is-near/aurora-engine/pull/871

## [3.3.1] 2023-10-26

### Fixes

- The smart contract owner whose account id is not the same as the contract account id can set ERC-20 metadata
by [@aleksuss] ([#858]).
by [@aleksuss]. ([#858])

[#858]: https://github.com/aurora-is-near/aurora-engine/pull/858

Expand All @@ -33,18 +65,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.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])

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]. ([#845])

- 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]: https://github.com/aurora-is-near/aurora-engine/pull/746
Expand All @@ -59,9 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Additions

- Added the possibility to use native NEAR instead of wNEAR on Aurora by [@karim-en]. ([#750])

- Added hashchain integration by [@birchmd]. ([#831])

- Added functions for setting and getting metadata of ERC-20 contracts deployed with `deploy_erc20_token` transaction
by [@aleksuss]. ([#837])

Expand Down Expand Up @@ -547,7 +573,8 @@ struct SubmitResult {

## [1.0.0] - 2021-05-12

[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.1...develop
[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.4.0...develop
[3.4.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.1...3.4.0
[3.3.1]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.0...3.3.1
[3.3.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.1.0...3.2.0
Expand Down
48 changes: 7 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ near-sdk = "4"
near-vm-errors = "0.17"
near-vm-logic = "0.17"
near-vm-runner = { version = "0.17", default-features = false, features = [ "wasmer2_vm", "wasmtime_vm" ] }
near-units = "0.2"
near-workspaces = "0.8"
near-workspaces = "0.9"
num = { version = "0.4", default-features = false, features = ["alloc"] }
postgres = "0.19"
primitive-types = { version = "0.12", default-features = false, features = ["rlp", "serde_no_std"] }
Expand Down Expand Up @@ -129,3 +128,11 @@ rpath = false
# it to actually happen when running tests with --release
lto = true
opt-level = 3

# The profile is needed for faster linking in case we need to run locally a small amount of tests or just test
# business logic rather than test gas cost. E.g. of using the profile with the cargo:
# `cargo test --profile fast-link --features mainnet-test name_of_test_we_want_execute`
[profile.fast-link]
inherits = "dev"
opt-level = 0
lto = false
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.1
3.4.0
2 changes: 1 addition & 1 deletion engine-precompiles/src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ impl<I: IO> Precompile for ExitToNear<I> {
// First byte of the input is a flag, selecting the behavior to be triggered:
// 0x0 -> Eth transfer
// 0x1 -> Erc20 transfer
let flag = input[0];
let flag = input.first().copied().unwrap_or_default();
#[cfg(feature = "error_refund")]
let (refund_address, mut input) = parse_input(input)?;
#[cfg(not(feature = "error_refund"))]
Expand Down
10 changes: 7 additions & 3 deletions engine-precompiles/src/xcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mod consts {
pub(super) const ERR_SERIALIZE: &str = "ERR_XCC_CALL_SERIALIZE";
pub(super) const ERR_STATIC: &str = "ERR_INVALID_IN_STATIC";
pub(super) const ERR_DELEGATE: &str = "ERR_INVALID_IN_DELEGATE";
pub(super) const ERR_XCC_ACCOUNT_ID: &str = "ERR_FAILED_TO_CREATE_XCC_ACCOUNT_ID";
pub(super) const ROUTER_EXEC_NAME: &str = "execute";
pub(super) const ROUTER_SCHEDULE_NAME: &str = "schedule";
/// Solidity selector for the ERC-20 transferFrom function
Expand Down Expand Up @@ -130,7 +131,7 @@ impl<I: IO> HandleBasedPrecompile for CrossContractCall<I> {
}

let sender = context.caller;
let target_account_id = create_target_account_id(sender, self.engine_account_id.as_ref());
let target_account_id = create_target_account_id(sender, self.engine_account_id.as_ref())?;
let args = CrossContractCallArgs::try_from_slice(input)
.map_err(|_| ExitError::Other(Cow::from(consts::ERR_INVALID_INPUT)))?;
let (promise, attached_near) = match args {
Expand Down Expand Up @@ -295,10 +296,13 @@ fn transfer_from_args(from: H160, to: H160, amount: U256) -> Vec<u8> {
[&consts::TRANSFER_FROM_SELECTOR, args.as_slice()].concat()
}

fn create_target_account_id(sender: H160, engine_account_id: &str) -> AccountId {
fn create_target_account_id(
sender: H160,
engine_account_id: &str,
) -> Result<AccountId, PrecompileFailure> {
format!("{}.{}", hex::encode(sender.as_bytes()), engine_account_id)
.parse()
.unwrap_or_default()
.map_err(|_| revert_with_message(consts::ERR_XCC_ACCOUNT_ID))
}

fn revert_with_message(message: &str) -> PrecompileFailure {
Expand Down
Loading

0 comments on commit 4e67385

Please sign in to comment.