Skip to content

Commit

Permalink
Merge pull request ethereum#107 from OffchainLabs/remove-internaltx-s…
Browse files Browse the repository at this point in the history
…ubtype

Remove internaltx subtype
  • Loading branch information
PlasmaPower authored Jun 18, 2022
2 parents 7e332b7 + 4a00cd8 commit b37353c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 37 deletions.
10 changes: 2 additions & 8 deletions core/types/arb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,8 @@ func (d *ArbitrumDepositTx) setSignatureValues(chainID, v, r, s *big.Int) {
}

type ArbitrumInternalTx struct {
ChainId *big.Int
SubType uint8
Data []byte
L2BlockNumber uint64
TxIndex uint64
ChainId *big.Int
Data []byte
}

func (t *ArbitrumInternalTx) txType() byte {
Expand All @@ -361,10 +358,7 @@ func (t *ArbitrumInternalTx) txType() byte {
func (t *ArbitrumInternalTx) copy() TxData {
return &ArbitrumInternalTx{
new(big.Int).Set(t.ChainId),
t.SubType,
common.CopyBytes(t.Data),
t.L2BlockNumber,
t.TxIndex,
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type Transaction struct {
time time.Time // Time first seen locally (spam avoidance)

// Arbitrum cache
PosterCost *big.Int
PosterCost *big.Int
CalldataUnits uint64

// caches
hash atomic.Value
Expand Down
23 changes: 2 additions & 21 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ type txJSON struct {
AccessList *AccessList `json:"accessList,omitempty"`

// Arbitrum fields:
SubType *hexutil.Uint64 `json:"subType,omitempty"` // Internal
L2BlockNumber *hexutil.Uint64 `json:"l2BlockNumber,omitempty"` // Internal
TxIndex *hexutil.Uint64 `json:"txIndex,omitempty"` // Internal
From *common.Address `json:"from,omitempty"` // Contract SubmitRetryable Unsigned Retry
RequestId *common.Hash `json:"requestId,omitempty"` // Contract SubmitRetryable Deposit
TicketId *common.Hash `json:"ticketId,omitempty"` // Retry
Expand Down Expand Up @@ -131,10 +128,6 @@ func (t *Transaction) MarshalJSON() ([]byte, error) {
enc.R = (*hexutil.Big)(tx.R)
enc.S = (*hexutil.Big)(tx.S)
case *ArbitrumInternalTx:
subType := uint64(tx.SubType)
enc.SubType = (*hexutil.Uint64)(&subType)
enc.L2BlockNumber = (*hexutil.Uint64)(&tx.L2BlockNumber)
enc.TxIndex = (*hexutil.Uint64)(&tx.TxIndex)
enc.ChainID = (*hexutil.Big)(tx.ChainId)
enc.Data = (*hexutil.Bytes)(&tx.Data)
case *ArbitrumDepositTx:
Expand Down Expand Up @@ -399,24 +392,12 @@ func (t *Transaction) UnmarshalJSON(input []byte) error {
if dec.ChainID == nil {
return errors.New("missing required field 'chainId' in transaction")
}
if dec.SubType == nil {
return errors.New("missing required field 'subType' in transaction")
}
if dec.Data == nil {
return errors.New("missing required field 'input' in transaction")
}
if dec.L2BlockNumber == nil {
return errors.New("missing required field 'l2BlockNumber' in transaction")
}
if dec.TxIndex == nil {
return errors.New("missing required field 'txIndex' in transaction")
}
inner = &ArbitrumInternalTx{
ChainId: (*big.Int)(dec.ChainID),
SubType: uint8(*dec.SubType),
Data: *dec.Data,
L2BlockNumber: uint64(*dec.L2BlockNumber),
TxIndex: uint64(*dec.TxIndex),
ChainId: (*big.Int)(dec.ChainID),
Data: *dec.Data,
}

case ArbitrumDepositTxType:
Expand Down
7 changes: 0 additions & 7 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,6 @@ type RPCTransaction struct {
S *hexutil.Big `json:"s"`

// Arbitrum fields:
SubType *hexutil.Uint64 `json:"subType,omitempty"` // Internal
L2BlockNumber *hexutil.Uint64 `json:"l2BlockNumber,omitempty"` // Internal
TxIndex *hexutil.Uint64 `json:"txIndex,omitempty"` // Internal
RequestId *common.Hash `json:"requestId,omitempty"` // Contract SubmitRetryable Deposit
TicketId *common.Hash `json:"ticketId,omitempty"` // Retry
RefundTo *common.Address `json:"refundTo,omitempty"` // SubmitRetryable Retry
Expand Down Expand Up @@ -1444,10 +1441,6 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
// Arbitrum: support arbitrum-specific transaction types
switch inner := tx.GetInner().(type) {
case *types.ArbitrumInternalTx:
subType := uint64(inner.SubType)
result.SubType = (*hexutil.Uint64)(&subType)
result.L2BlockNumber = (*hexutil.Uint64)(&inner.L2BlockNumber)
result.TxIndex = (*hexutil.Uint64)(&inner.TxIndex)
result.ChainID = (*hexutil.Big)(inner.ChainId)
case *types.ArbitrumDepositTx:
result.RequestId = &inner.L1RequestId
Expand Down

0 comments on commit b37353c

Please sign in to comment.