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

Cancun support #2795

Merged
merged 21 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions Cargo.lock

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

10 changes: 2 additions & 8 deletions runtime/moonbase/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2586,17 +2586,11 @@ fn empty_account_should_not_be_reset() {
parachain::EVM::remove_account(&evm_account());
// Verify reference count.
let account = parachain::System::account(evm_account_id);
// TODO: after introducing the suicided fix the value for account.sufficients will remain 1
// until the storage is not completely removed, it will have to be decreased to 0 once the
// storage can be fully removed
assert_eq!(account.sufficients, 1);
assert_eq!(account.sufficients, 0);
assert_eq!(account.consumers, 0);
assert_eq!(account.providers, 1);
// We expect the account to be alive in a Zero ED context.
// TODO: after introducing the suicided fix the nonce is increased by 1
// until the storage is not completely removed, it will have to be decreased to 1 once the
// storage can be fully removed
assert_eq!(parachain::System::account_nonce(evm_account_id), 2);
assert_eq!(parachain::System::account_nonce(evm_account_id), 1);
});
}

Expand Down
12 changes: 2 additions & 10 deletions runtime/moonbeam/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2310,19 +2310,11 @@ fn empty_account_should_not_be_reset() {
parachain::EVM::remove_account(&evm_account());
// Verify reference count.
let account = parachain::System::account(evm_account_id);
// TODO: since the suicided logic was introduced an smart contract account
// is not deleted completely until it's data is deleted. Data deletion
// will be implemented in a future release
// account.sufficients shall be 0
assert_eq!(account.sufficients, 1);
assert_eq!(account.sufficients, 0);
assert_eq!(account.consumers, 0);
assert_eq!(account.providers, 1);
// We expect the account to be alive in a Zero ED context.
// TODO: since the suicided logic was introduced an smart contract account
// is not deleted completely until it's data is deleted. Data deletion
// will be implemented in a future release
// this shall be changed to 1
assert_eq!(parachain::System::account_nonce(evm_account_id), 2);
assert_eq!(parachain::System::account_nonce(evm_account_id), 1);
});
}

Expand Down
12 changes: 2 additions & 10 deletions runtime/moonriver/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2620,19 +2620,11 @@ fn empty_account_should_not_be_reset() {
parachain::EVM::remove_account(&evm_account());
// Verify reference count.
let account = parachain::System::account(evm_account_id);
// TODO: since the suicided logic was introduced an smart contract account
// is not deleted completely until it's data is deleted. Data deletion
// will be implemented in a future release
// revert account.sufficients to 0
assert_eq!(account.sufficients, 1);
assert_eq!(account.sufficients, 0);
assert_eq!(account.consumers, 0);
assert_eq!(account.providers, 1);
// We expect the account to be alive in a Zero ED context.
// TODO: since the suicided logic was introduced an smart contract account
// is not deleted completely until it's data is deleted. Data deletion
// will be implemented in a future release
// the following needs to be 1
assert_eq!(parachain::System::account_nonce(evm_account_id), 2);
assert_eq!(parachain::System::account_nonce(evm_account_id), 1);
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/contracts/src/ERC20ExcessGas.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract ERC20ExcessGas is ERC20WithInitialSupply {
uint256 amount
) public override returns (bool) {
// Consume gas to over Erc20XcmBridgeTransferGasLimit
for (uint i = 0; i < 2000; i++) {
for (uint i = 0; i < 2200; i++) {
_gasHog += i;
}

Expand Down
23 changes: 23 additions & 0 deletions test/contracts/src/dancun/ProxySuicide.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.24;

contract ProxyDeployer {
event ContractDestroyed(address destroyedAddress);

// Function to deploy a new Suicide contract
function deployAndDestroy(address target) public {
Suicide newContract = new Suicide();
newContract.destroy(target);
emit ContractDestroyed(address(newContract));
}

}

contract Suicide {
constructor() payable {
}

function destroy(address target) public {
selfdestruct(payable(target));
}
}
Loading
Loading