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
83c2516e
Unverified
Commit
83c2516e
authored
Sep 08, 2021
by
kf
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: have coinbase always return fee vault
parent
db903270
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
1 deletion
+10
-1
OVMContextStorage.sol
integration-tests/contracts/OVMContextStorage.sol
+2
-0
ovmcontext.spec.ts
integration-tests/test/ovmcontext.spec.ts
+5
-0
evm.go
l2geth/core/evm.go
+2
-1
constants.go
l2geth/rollup/dump/constants.go
+1
-0
No files found.
integration-tests/contracts/OVMContextStorage.sol
View file @
83c2516e
...
@@ -6,12 +6,14 @@ contract OVMContextStorage {
...
@@ -6,12 +6,14 @@ contract OVMContextStorage {
mapping (uint256 => uint256) public blockNumbers;
mapping (uint256 => uint256) public blockNumbers;
mapping (uint256 => uint256) public timestamps;
mapping (uint256 => uint256) public timestamps;
mapping (uint256 => uint256) public difficulty;
mapping (uint256 => uint256) public difficulty;
mapping (uint256 => address) public coinbases;
uint256 public index = 0;
uint256 public index = 0;
fallback() external {
fallback() external {
blockNumbers[index] = block.number;
blockNumbers[index] = block.number;
timestamps[index] = block.timestamp;
timestamps[index] = block.timestamp;
difficulty[index] = block.difficulty;
difficulty[index] = block.difficulty;
coinbases[index] = block.coinbase;
index++;
index++;
}
}
}
}
integration-tests/test/ovmcontext.spec.ts
View file @
83c2516e
...
@@ -3,6 +3,7 @@ import { expect } from 'chai'
...
@@ -3,6 +3,7 @@ import { expect } from 'chai'
/* Imports: External */
/* Imports: External */
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
predeploys
}
from
'
@eth-optimism/contracts
'
import
{
Contract
,
BigNumber
}
from
'
ethers
'
import
{
Contract
,
BigNumber
}
from
'
ethers
'
/* Imports: Internal */
/* Imports: Internal */
...
@@ -76,6 +77,10 @@ describe('OVM Context: Layer 2 EVM Context', () => {
...
@@ -76,6 +77,10 @@ describe('OVM Context: Layer 2 EVM Context', () => {
// Difficulty should always be zero.
// Difficulty should always be zero.
const
difficulty
=
await
OVMContextStorage
.
difficulty
(
i
)
const
difficulty
=
await
OVMContextStorage
.
difficulty
(
i
)
expect
(
difficulty
.
toNumber
()).
to
.
equal
(
0
)
expect
(
difficulty
.
toNumber
()).
to
.
equal
(
0
)
// Coinbase should always be sequencer fee vault.
const
coinbase
=
await
OVMContextStorage
.
coinbases
(
i
)
expect
(
coinbase
).
to
.
equal
(
predeploys
.
OVM_SequencerFeeVault
)
}
}
}).
timeout
(
150000
)
// this specific test takes a while because it involves L1 to L2 txs
}).
timeout
(
150000
)
// this specific test takes a while because it involves L1 to L2 txs
...
...
l2geth/core/evm.go
View file @
83c2516e
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/rollup/dump"
"github.com/ethereum/go-ethereum/rollup/rcfg"
"github.com/ethereum/go-ethereum/rollup/rcfg"
)
)
...
@@ -65,7 +66,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author
...
@@ -65,7 +66,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author
Transfer
:
Transfer
,
Transfer
:
Transfer
,
GetHash
:
GetHashFn
(
header
,
chain
),
GetHash
:
GetHashFn
(
header
,
chain
),
Origin
:
msg
.
From
(),
Origin
:
msg
.
From
(),
Coinbase
:
beneficiary
,
Coinbase
:
dump
.
OvmFeeWallet
,
// Coinbase is the fee vault.
BlockNumber
:
msg
.
L1BlockNumber
(),
BlockNumber
:
msg
.
L1BlockNumber
(),
Time
:
new
(
big
.
Int
)
.
SetUint64
(
msg
.
L1Timestamp
()),
Time
:
new
(
big
.
Int
)
.
SetUint64
(
msg
.
L1Timestamp
()),
Difficulty
:
new
(
big
.
Int
),
// Difficulty always returns zero.
Difficulty
:
new
(
big
.
Int
),
// Difficulty always returns zero.
...
...
l2geth/rollup/dump/constants.go
View file @
83c2516e
...
@@ -5,3 +5,4 @@ import (
...
@@ -5,3 +5,4 @@ import (
)
)
var
OvmEthAddress
=
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000006"
)
var
OvmEthAddress
=
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000006"
)
var
OvmFeeWallet
=
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000011"
)
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