Skip to content

Commit 4e67385

Browse files
aleksussdependabot[bot]birchmdguidovrankenjoshuajbouw
committed
Release 3.4.0 (#874)
## [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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Birch <michael.birch@aurora.dev> Co-authored-by: Guido Vranken <guidovranken@users.noreply.github.com> Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
1 parent 9963486 commit 4e67385

57 files changed

Lines changed: 1444 additions & 650 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGES.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [3.4.0] 2023-11-28
11+
12+
### Additions
13+
14+
- Added a possibility to pass initialize arguments in json format to the `new` transaction by [@aleksuss]. ([#871])
15+
- The `SubmitResult` was made available for `ft_on_transfer` transactions in the standalone engine by [@birchmd]. ([#869])
16+
- The order of producing the exit precompile and XCC promises has been changed to sequential by [@birchmd]. ([#868])
17+
18+
### Changes
19+
20+
- Removed the code hidden behind the feature that isn't used anymore by [@joshuajbouw]. ([#870])
21+
- The logic of unwrapping wNEAR has been changed to the Bridge's native by [@birchmd]. ([#867])
22+
- Bumped the `near-workspaces` to 0.9 by [@aleksuss]. ([#862])
23+
24+
### Fixes
25+
26+
- Add a method for upgrading XCC router contract by [@birchmd]. ([#866])
27+
- Fixed a potential panic in the `ExitToNear` precompile by [@guidovranken]. ([#865])
28+
- Fixed a behaviour when the `ft_transfer` could occur before the `near_withdraw` by [@birchmd]. ([#864])
29+
- Fixed correctness of reproducing the NEAR runtime random value in the standalone engine by [@birchmd]. ([#863])
30+
31+
[#862]: https://github.com/aurora-is-near/aurora-engine/pull/862
32+
[#863]: https://github.com/aurora-is-near/aurora-engine/pull/863
33+
[#864]: https://github.com/aurora-is-near/aurora-engine/pull/864
34+
[#865]: https://github.com/aurora-is-near/aurora-engine/pull/865
35+
[#866]: https://github.com/aurora-is-near/aurora-engine/pull/866
36+
[#867]: https://github.com/aurora-is-near/aurora-engine/pull/867
37+
[#868]: https://github.com/aurora-is-near/aurora-engine/pull/868
38+
[#869]: https://github.com/aurora-is-near/aurora-engine/pull/869
39+
[#870]: https://github.com/aurora-is-near/aurora-engine/pull/870
40+
[#871]: https://github.com/aurora-is-near/aurora-engine/pull/871
41+
1042
## [3.3.1] 2023-10-26
1143

1244
### Fixes
1345

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

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

@@ -33,18 +65,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3365
### Changes
3466

3567
- Changed structure `SetEthConnectorContractAccountArgs` for setting eth connector account. It was extended with
36-
additional field: `withdraw_serialize_type` for defining serialization type for withdraw arguments by [@aleksuss]. ([#834])
37-
68+
additional field: `withdraw_serialize_type` for defining serialization type for withdraw arguments by [@aleksuss]. ([#834])
3869
- Updated rocksdb up to 0.21.0 by [@aleksuss]. ([#840])
3970

4071
### Additions
4172

4273
- Added a possibility of mirroring deployed ERC-20 contracts in the main Aurora contract in Silo mode by [@aleksuss]. ([#845])
43-
4474
- Allow to initialize hashchain directly with the `new` method by [@birchmd]. ([#846])
45-
4675
- Added a silo logic which allows to set fixed gas costs per transaction by [@aleksuss]. ([#746])
47-
4876
- Added a new type of transaction which allows to add full access key into account of the smart contract by [@aleksuss]. ([#847])
4977

5078
[#746]: https://github.com/aurora-is-near/aurora-engine/pull/746
@@ -59,9 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5987
### Additions
6088

6189
- Added the possibility to use native NEAR instead of wNEAR on Aurora by [@karim-en]. ([#750])
62-
6390
- Added hashchain integration by [@birchmd]. ([#831])
64-
6591
- Added functions for setting and getting metadata of ERC-20 contracts deployed with `deploy_erc20_token` transaction
6692
by [@aleksuss]. ([#837])
6793

@@ -547,7 +573,8 @@ struct SubmitResult {
547573

548574
## [1.0.0] - 2021-05-12
549575

550-
[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.1...develop
576+
[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.4.0...develop
577+
[3.4.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.1...3.4.0
551578
[3.3.1]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.0...3.3.1
552579
[3.3.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.2.0...3.3.0
553580
[3.2.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.1.0...3.2.0

Cargo.lock

Lines changed: 7 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ near-sdk = "4"
5252
near-vm-errors = "0.17"
5353
near-vm-logic = "0.17"
5454
near-vm-runner = { version = "0.17", default-features = false, features = [ "wasmer2_vm", "wasmtime_vm" ] }
55-
near-units = "0.2"
56-
near-workspaces = "0.8"
55+
near-workspaces = "0.9"
5756
num = { version = "0.4", default-features = false, features = ["alloc"] }
5857
postgres = "0.19"
5958
primitive-types = { version = "0.12", default-features = false, features = ["rlp", "serde_no_std"] }
@@ -129,3 +128,11 @@ rpath = false
129128
# it to actually happen when running tests with --release
130129
lto = true
131130
opt-level = 3
131+
132+
# The profile is needed for faster linking in case we need to run locally a small amount of tests or just test
133+
# business logic rather than test gas cost. E.g. of using the profile with the cargo:
134+
# `cargo test --profile fast-link --features mainnet-test name_of_test_we_want_execute`
135+
[profile.fast-link]
136+
inherits = "dev"
137+
opt-level = 0
138+
lto = false

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.1
1+
3.4.0

engine-precompiles/src/native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<I: IO> Precompile for ExitToNear<I> {
349349
// First byte of the input is a flag, selecting the behavior to be triggered:
350350
// 0x0 -> Eth transfer
351351
// 0x1 -> Erc20 transfer
352-
let flag = input[0];
352+
let flag = input.first().copied().unwrap_or_default();
353353
#[cfg(feature = "error_refund")]
354354
let (refund_address, mut input) = parse_input(input)?;
355355
#[cfg(not(feature = "error_refund"))]

engine-precompiles/src/xcc.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ mod consts {
5252
pub(super) const ERR_SERIALIZE: &str = "ERR_XCC_CALL_SERIALIZE";
5353
pub(super) const ERR_STATIC: &str = "ERR_INVALID_IN_STATIC";
5454
pub(super) const ERR_DELEGATE: &str = "ERR_INVALID_IN_DELEGATE";
55+
pub(super) const ERR_XCC_ACCOUNT_ID: &str = "ERR_FAILED_TO_CREATE_XCC_ACCOUNT_ID";
5556
pub(super) const ROUTER_EXEC_NAME: &str = "execute";
5657
pub(super) const ROUTER_SCHEDULE_NAME: &str = "schedule";
5758
/// Solidity selector for the ERC-20 transferFrom function
@@ -130,7 +131,7 @@ impl<I: IO> HandleBasedPrecompile for CrossContractCall<I> {
130131
}
131132

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

298-
fn create_target_account_id(sender: H160, engine_account_id: &str) -> AccountId {
299+
fn create_target_account_id(
300+
sender: H160,
301+
engine_account_id: &str,
302+
) -> Result<AccountId, PrecompileFailure> {
299303
format!("{}.{}", hex::encode(sender.as_bytes()), engine_account_id)
300304
.parse()
301-
.unwrap_or_default()
305+
.map_err(|_| revert_with_message(consts::ERR_XCC_ACCOUNT_ID))
302306
}
303307

304308
fn revert_with_message(message: &str) -> PrecompileFailure {

0 commit comments

Comments
 (0)