Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0577e787
Commit
0577e787
authored
Jun 08, 2022
by
Matthew Slipper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "contracts: optimize `L1Block.setL1BlockValues` (#2596)"
This reverts commit
2d791301
.
parent
7c5ac36f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
25 deletions
+19
-25
l1block.go
op-bindings/bindings/l1block.go
+1
-1
l1block_deployed.go
op-bindings/bindings/l1block_deployed.go
+1
-1
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+7
-7
L1Block.sol
packages/contracts-bedrock/contracts/L2/L1Block.sol
+10
-16
No files found.
op-bindings/bindings/l1block.go
View file @
0577e787
...
...
@@ -31,7 +31,7 @@ var (
// L1BlockMetaData contains all meta data concerning the L1Block contract.
var
L1BlockMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[],
\"
name
\"
:
\"
OnlyDepositor
\"
,
\"
type
\"
:
\"
error
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
DEPOSITOR_ACCOUNT
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
basefee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
hash
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
number
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
sequenceNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"
_number
\"
,
\"
type
\"
:
\"
uint64
\"
},{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"
_timestamp
\"
,
\"
type
\"
:
\"
uint64
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_basefee
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_hash
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"
_sequenceNumber
\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
name
\"
:
\"
setL1BlockValues
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
timestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x608060405234801561001057600080fd5b506102
5a806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806364ca23ef1161005b57806364ca23ef146100bc5780638381f58a146100fd578063b80777ea14610111578063e591b2821461013157600080fd5b8063042c2f571461008257806309bd5a60146100975780635cf24969146100b3575b600080fd5b6100956100903660046101f6565b610171565b005b6100a060025481565b6040519081526020015b60405180910390f35b6100a060015481565b6000546100e490700100000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100aa565b6000546100e49067ffffffffffffffff1681565b6000546100e49068010000000000000000900467ffffffffffffffff1681565b61014c73deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146101be576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60801b60409390931b90931791909117600055600155600255565b803567ffffffffffffffff811681146101f157600080fd5b919050565b600080600080600060a0868803121561020e57600080fd5b610217866101d9565b9450610225602087016101d9565b93506040860135925060608601359150610241608087016101d9
565b9050929550929590935056fea164736f6c634300080a000a"
,
Bin
:
"0x608060405234801561001057600080fd5b506102
b0806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806364ca23ef1161005b57806364ca23ef146100bc5780638381f58a146100e9578063b80777ea146100fd578063e591b2821461011d57600080fd5b8063042c2f571461008257806309bd5a60146100975780635cf24969146100b3575b600080fd5b61009561009036600461024c565b61015d565b005b6100a060025481565b6040519081526020015b60405180910390f35b6100a060015481565b6003546100d09067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100aa565b6000546100d09067ffffffffffffffff1681565b6000546100d09068010000000000000000900467ffffffffffffffff1681565b61013873deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146101aa576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b803567ffffffffffffffff8116811461024757600080fd5b919050565b600080600080600060a0868803121561026457600080fd5b61026d8661022f565b945061027b6020870161022f565b935060408601359250606086013591506102976080870161022f
565b9050929550929590935056fea164736f6c634300080a000a"
,
}
// L1BlockABI is the input ABI used to generate the binding from.
...
...
op-bindings/bindings/l1block_deployed.go
View file @
0577e787
...
...
@@ -2,4 +2,4 @@
// This file is a generated binding and any manual changes will be lost.
package
bindings
var
L1BlockDeployedBin
=
"0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806364ca23ef1161005b57806364ca23ef146100bc5780638381f58a146100
fd578063b80777ea14610111578063e591b2821461013157600080fd5b8063042c2f571461008257806309bd5a60146100975780635cf24969146100b3575b600080fd5b6100956100903660046101f6565b610171565b005b6100a060025481565b6040519081526020015b60405180910390f35b6100a060015481565b6000546100e490700100000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100aa565b6000546100e49067ffffffffffffffff1681565b6000546100e49068010000000000000000900467ffffffffffffffff1681565b61014c73deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146101be576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60801b60409390931b90931791909117600055600155600255565b803567ffffffffffffffff811681146101f157600080fd5b919050565b600080600080600060a0868803121561020e57600080fd5b610217866101d9565b9450610225602087016101d9565b93506040860135925060608601359150610241608087016101d9
565b9050929550929590935056fea164736f6c634300080a000a"
var
L1BlockDeployedBin
=
"0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806364ca23ef1161005b57806364ca23ef146100bc5780638381f58a146100
e9578063b80777ea146100fd578063e591b2821461011d57600080fd5b8063042c2f571461008257806309bd5a60146100975780635cf24969146100b3575b600080fd5b61009561009036600461024c565b61015d565b005b6100a060025481565b6040519081526020015b60405180910390f35b6100a060015481565b6003546100d09067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100aa565b6000546100d09067ffffffffffffffff1681565b6000546100d09068010000000000000000900467ffffffffffffffff1681565b61013873deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146101aa576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b803567ffffffffffffffff8116811461024757600080fd5b919050565b600080600080600060a0868803121561026457600080fd5b61026d8661022f565b945061027b6020870161022f565b935060408601359250606086013591506102976080870161022f
565b9050929550929590935056fea164736f6c634300080a000a"
packages/contracts-bedrock/.gas-snapshot
View file @
0577e787
CrossDomainHashing_Test:test_l2TransactionHash() (gas:
7863
9)
CrossDomainHashing_Test:test_l2TransactionHash() (gas:
10379
9)
DeployerWhitelist_Test:test_owner() (gas: 7647)
DeployerWhitelist_Test:test_storageSlots() (gas: 33483)
GasPriceOracle_Test:test_baseFee() (gas: 8395)
...
...
@@ -9,20 +9,20 @@ GasPriceOracle_Test:test_onlyOwnerSetOverhead() (gas: 10599)
GasPriceOracle_Test:test_onlyOwnerSetScalar() (gas: 10640)
GasPriceOracle_Test:test_owner() (gas: 9762)
GasPriceOracle_Test:test_setDecimals() (gas: 36798)
GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11
659
)
GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 11
658
)
GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11
718
)
GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 11
717
)
GasPriceOracle_Test:test_setOverhead() (gas: 36767)
GasPriceOracle_Test:test_setScalar() (gas: 36840)
GasPriceOracle_Test:test_storageLayout() (gas: 86683)
L1BlockTest:test_basefee() (gas: 7575)
L1BlockTest:test_hash() (gas: 7552)
L1BlockTest:test_number() (gas: 7651)
L1BlockTest:test_sequenceNumber() (gas: 75
96
)
L1BlockTest:test_sequenceNumber() (gas: 75
85
)
L1BlockTest:test_timestamp() (gas: 7683)
L1BlockTest:test_updateValues() (gas: 2
3144
)
L1BlockNumberTest:test_fallback() (gas: 1
0755
)
L1BlockTest:test_updateValues() (gas: 2
8215
)
L1BlockNumberTest:test_fallback() (gas: 1
8773
)
L1BlockNumberTest:test_getL1BlockNumber() (gas: 10589)
L1BlockNumberTest:test_receive() (gas:
17418
)
L1BlockNumberTest:test_receive() (gas:
25436
)
L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 10909)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 8366)
L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 31882)
...
...
packages/contracts-bedrock/contracts/L2/L1Block.sol
View file @
0577e787
...
...
@@ -30,11 +30,6 @@ contract L1Block {
*/
uint64 public timestamp;
/**
* @notice The number of L2 blocks in the same epoch
*/
uint64 public sequenceNumber;
/**
* @notice The latest L1 basefee
*/
...
...
@@ -45,6 +40,11 @@ contract L1Block {
*/
bytes32 public hash;
/**
* @notice The number of L2 blocks in the same epoch
*/
uint64 public sequenceNumber;
/**
* @notice Sets the L1 values
* @param _number L1 blocknumber
...
...
@@ -64,16 +64,10 @@ contract L1Block {
revert OnlyDepositor();
}
bytes32 slot;
assembly {
// _number, _timestamp and _sequenceNumber are all uint64 and will
// be tightly packed together in the first storage slot
slot := or(slot, _number)
slot := or(slot, shl(64, _timestamp))
slot := or(slot, shl(128, _sequenceNumber))
sstore(0, slot)
sstore(basefee.slot, _basefee)
sstore(hash.slot, _hash)
}
number = _number;
timestamp = _timestamp;
basefee = _basefee;
hash = _hash;
sequenceNumber = _sequenceNumber;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment