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
96db49b9
Commit
96db49b9
authored
Oct 20, 2020
by
Karl Floersch
Committed by
GitHub
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused byte, for real this time (#28)
parent
c2a65c98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
OVM_CanonicalTransactionChain.sol
...stic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
+14
-6
OVM_CanonicalTransactionChain.spec.ts
...contracts/OVM/chain/OVM_CanonicalTransactionChain.spec.ts
+1
-1
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
View file @
96db49b9
...
...
@@ -34,7 +34,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
uint256 constant internal BATCH_CONTEXT_START_POS = 15;
uint256 constant internal TX_DATA_HEADER_SIZE = 3;
uint256 constant internal BYTES_TILL_TX_DATA = 6
6
;
uint256 constant internal BYTES_TILL_TX_DATA = 6
5
;
/*************
...
...
@@ -548,10 +548,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
assembly {
let chainElementStart := add(chainElement, 0x20)
// Set the first byte equal to `1` to indicate this is a sequencer chain element.
// This distinguishes sequencer ChainElements from queue ChainElements because
// all queue ChainElements are ABI encoded and the first byte of ABI encoded
// elements is always zero
mstore8(chainElementStart, 1)
mstore(add(chainElementStart,
2
), ctxTimestamp)
mstore(add(chainElementStart, 3
4
), ctxBlockNumber)
mstore(add(chainElementStart,
1
), ctxTimestamp)
mstore(add(chainElementStart, 3
3
), ctxBlockNumber)
calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
...
...
@@ -586,12 +590,16 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
assembly {
let chainElementStart := add(chainElement, 0x20)
// Set the first byte equal to `1` to indicate this is a sequencer chain element.
// This distinguishes sequencer ChainElements from queue ChainElements because
// all queue ChainElements are ABI encoded and the first byte of ABI encoded
// elements is always zero
mstore8(chainElementStart, 1)
mstore(add(chainElementStart,
2
), ctxTimestamp)
mstore(add(chainElementStart, 3
4
), ctxBlockNumber)
mstore(add(chainElementStart,
1
), ctxTimestamp)
mstore(add(chainElementStart, 3
3
), ctxBlockNumber)
pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart,
66
), txDataLength))
pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart,
BYTES_TILL_TX_DATA
), txDataLength))
leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
}
...
...
packages/contracts/test/contracts/OVM/chain/OVM_CanonicalTransactionChain.spec.ts
View file @
96db49b9
...
...
@@ -41,7 +41,7 @@ const getSequencerLeafHash = (
data
:
string
):
string
=>
{
return
keccak256
(
'
0x01
00
'
+
'
0x01
'
+
remove0x
(
BigNumber
.
from
(
timestamp
).
toHexString
()).
padStart
(
64
,
'
0
'
)
+
remove0x
(
BigNumber
.
from
(
blockNumber
).
toHexString
()).
padStart
(
64
,
'
0
'
)
+
remove0x
(
data
)
...
...
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