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
ce7fa52b
Unverified
Commit
ce7fa52b
authored
May 06, 2021
by
Mark Tyneway
Committed by
GitHub
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: tx enums (#781)
* enums: use additional enum for eth_sign txs * chore: add changeset
parent
575bcf68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
fluffy-mangos-rest.md
.changeset/fluffy-mangos-rest.md
+6
-0
ecdsa-coder.ts
packages/core-utils/src/coders/ecdsa-coder.ts
+20
-0
sequencer-batch-appended.ts
...ervices/l1-ingestion/handlers/sequencer-batch-appended.ts
+3
-0
No files found.
.changeset/fluffy-mangos-rest.md
0 → 100644
View file @
ce7fa52b
---
'
@eth-optimism/core-utils'
:
patch
'
@eth-optimism/data-transport-layer'
:
patch
---
Add an additional enum for EthSign transactions as they now are batch submitted with 2 different enum values
packages/core-utils/src/coders/ecdsa-coder.ts
View file @
ce7fa52b
...
...
@@ -9,11 +9,13 @@ import { Coder, Signature, Uint16, Uint8, Uint24, Address } from './types'
export
enum
TxType
{
EIP155
=
0
,
EthSign
=
1
,
EthSign2
=
2
,
}
export
const
txTypePlainText
=
{
0
:
TxType
.
EIP155
,
1
:
TxType
.
EthSign
,
2
:
TxType
.
EthSign2
,
EIP155
:
TxType
.
EIP155
,
EthSign
:
TxType
.
EthSign
,
}
...
...
@@ -169,6 +171,20 @@ class EthSignTxCoder extends DefaultEcdsaTxCoder {
}
}
class
EthSign2TxCoder
extends
DefaultEcdsaTxCoder
{
constructor
()
{
super
(
TxType
.
EthSign2
)
}
public
encode
(
txData
:
EthSignTxData
):
string
{
return
super
.
encode
(
txData
)
}
public
decode
(
txData
:
string
):
EthSignTxData
{
return
super
.
decode
(
txData
)
}
}
class
Eip155TxCoder
extends
DefaultEcdsaTxCoder
{
constructor
()
{
super
(
TxType
.
EIP155
)
...
...
@@ -209,6 +225,9 @@ function decode(data: string | Buffer): EIP155TxData {
if
(
type
===
TxType
.
EthSign
)
{
return
new
EthSignTxCoder
().
decode
(
data
)
}
if
(
type
===
TxType
.
EthSign2
)
{
return
new
EthSign2TxCoder
().
decode
(
data
)
}
return
null
}
...
...
@@ -218,6 +237,7 @@ function decode(data: string | Buffer): EIP155TxData {
export
const
ctcCoder
=
{
eip155TxData
:
new
Eip155TxCoder
(),
ethSignTxData
:
new
EthSignTxCoder
(),
ethSign2TxData
:
new
EthSign2TxCoder
(),
encode
,
decode
,
}
packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts
View file @
ce7fa52b
...
...
@@ -254,6 +254,9 @@ const maybeDecodeSequencerBatchTransaction = (
}
else
if
(
txType
===
TxType
.
EthSign
)
{
type
=
'
ETH_SIGN
'
decoded
=
ctcCoder
.
ethSignTxData
.
decode
(
transaction
.
toString
(
'
hex
'
))
}
else
if
(
txType
===
TxType
.
EthSign2
)
{
type
=
'
ETH_SIGN
'
decoded
=
ctcCoder
.
ethSign2TxData
.
decode
(
transaction
.
toString
(
'
hex
'
))
}
else
{
throw
new
Error
(
`Unknown sequencer transaction type.`
)
}
...
...
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