Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into 0922_fix_compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi committed Oct 5, 2023
2 parents 6140462 + ba9835a commit 196706b
Show file tree
Hide file tree
Showing 84 changed files with 5,858 additions and 3,517 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: Bug report
about: Use this template for reporting issues
name: Scripts-Related Bug Report
about: Use this template for reporting script related bugs. For contract bugs, see our security policy.
title: ''
labels: bug
assignees: ''
---

### 🐛 Bug Report
### 🐛 Script Bug Report

#### 📝 Description

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.15.1
node-version: 18.18.0

- name: Install yarn
run: npm install -g yarn license-checker
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ typechain
build
yarn-debug.log*
yarn-error.log*
.yarn/
.yarnrc.yml
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.0
2 changes: 1 addition & 1 deletion SystemConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"L1_TX_INTRINSIC_L2_GAS": 167157,
"L1_TX_INTRINSIC_PUBDATA": 88,
"MAX_GAS_PER_TRANSACTION": 80000000,
"BOOTLOADER_MEMORY_FOR_TXS": 485225,
"BOOTLOADER_MEMORY_FOR_TXS": 273132,
"REFUND_GAS": 7343,
"KECCAK_ROUND_COST_GAS": 40,
"SHA256_ROUND_COST_GAS": 7,
Expand Down
811 changes: 504 additions & 307 deletions bootloader/bootloader.yul

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion contracts/AccountCodeStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {DEPLOYER_SYSTEM_CONTRACT, NONCE_HOLDER_SYSTEM_CONTRACT, CURRENT_MAX_PREC

/**
* @author Matter Labs
* @custom:security-contact security@matterlabs.dev
* @notice The storage of this contract serves as a mapping for the code hashes of the 32-byte account addresses.
* @dev Code hash is not strictly a hash, it's a structure where the first byte denotes the version of the hash,
* the second byte denotes whether the contract is constructed, and the next two bytes denote the length in 32-byte words.
Expand Down Expand Up @@ -44,7 +45,7 @@ contract AccountCodeStorage is IAccountCodeStorage {
/// but checks whether the bytecode hash corresponds to the constructed smart contract.
function storeAccountConstructedCodeHash(address _address, bytes32 _hash) external override onlyDeployer {
// Check that code hash corresponds to the deploying smart contract
require(Utils.isContractConstructed(_hash), "Code hash is not for a contract on constructor");
require(Utils.isContractConstructed(_hash), "Code hash is not for a constructed contract");
_storeCodeHash(_address, _hash);
}

Expand Down
1 change: 1 addition & 0 deletions contracts/BootloaderUtilities.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "./libraries/EfficientCall.sol";

/**
* @author Matter Labs
* @custom:security-contact security@matterlabs.dev
* @notice A contract that provides some utility methods for the bootloader
* that is very hard to write in Yul.
*/
Expand Down
92 changes: 0 additions & 92 deletions contracts/BytecodeCompressor.sol

This file was deleted.

10 changes: 4 additions & 6 deletions contracts/ComplexUpgrader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@

pragma solidity ^0.8.0;

import "./interfaces/IComplexUpgrader.sol";
import {IComplexUpgrader} from "./interfaces/IComplexUpgrader.sol";
import {FORCE_DEPLOYER} from "./Constants.sol";

/**
* @author Matter Labs
* @custom:security-contact security@matterlabs.dev
* @notice Upgrader which should be used to perform complex multistep upgrades on L2. In case some custom logic for an upgrade is needed
* this logic should be deployed into the user space and then this contract will delegatecall to the deployed contract.
*/
contract ComplexUpgrader is IComplexUpgrader {
/// @notice Executes an upgrade process by delegating calls to another contract.
/// @dev This function allows only the `FORCE_DEPLOYER` to initiate the upgrade.
/// @dev This function allows only the `FORCE_DEPLOYER` to initiate the upgrade.
/// If the delegate call fails, the function will revert the transaction, returning the error message
/// provided by the delegated contract.
/// @param _delegateTo the address of the contract to which the calls will be delegated
/// @param _calldata the calldata to be delegate called in the `_delegateTo` contract
function upgrade(
address _delegateTo,
bytes calldata _calldata
) external payable {
function upgrade(address _delegateTo, bytes calldata _calldata) external payable {
require(msg.sender == FORCE_DEPLOYER, "Can only be called by FORCE_DEPLOYER");

require(_delegateTo.code.length > 0, "Delegatee is an EOA");
Expand Down
Loading

0 comments on commit 196706b

Please sign in to comment.