Skip to content
This repository was archived by the owner on Aug 20, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import (
"sync/atomic"
"time"

"github.com/ethereum/go-ethereum/core/vm"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/prque"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
Expand Down
4 changes: 0 additions & 4 deletions core/types/deposit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import (
"github.com/ethereum/go-ethereum/common"
)

const (
DepositTxVersionZeroType = iota
)

const DepositTxType = 0x7E

type DepositTx struct {
Expand Down
3 changes: 0 additions & 3 deletions core/types/hashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ func prefixedRlpHash(prefix byte, x interface{}) (h common.Hash) {
defer hasherPool.Put(sha)
sha.Reset()
sha.Write([]byte{prefix})
if prefix == DepositTxType {
sha.Write([]byte{0})
}
rlp.Encode(sha, x)
sha.Read(h[:])
return h
Expand Down
16 changes: 1 addition & 15 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ var (
ErrTxTypeNotSupported = errors.New("transaction type not supported")
ErrGasFeeCapTooLow = errors.New("fee cap less than base fee")
errShortTypedTx = errors.New("typed transaction too short")

// Custom Errors for deposits
ErrDepositTxTypeNotSupported = errors.New("deposit transaction type not supported")
errUnversionedDeposit = errors.New("deposit transaction does not have version byte")
)

// Transaction types.
Expand Down Expand Up @@ -114,10 +110,6 @@ func (tx *Transaction) EncodeRLP(w io.Writer) error {
// encodeTyped writes the canonical encoding of a typed transaction to w.
func (tx *Transaction) encodeTyped(w *bytes.Buffer) error {
w.WriteByte(tx.Type())
// Only support v0 right now.
if tx.Type() == DepositTxType {
w.WriteByte(DepositTxVersionZeroType)
}
return rlp.Encode(w, tx.inner)
}

Expand Down Expand Up @@ -199,13 +191,7 @@ func (tx *Transaction) decodeTyped(b []byte) (TxData, error) {
return &inner, err
case DepositTxType:
var inner DepositTx
if len(b) < 2 {
return nil, errUnversionedDeposit
}
if b[1] != DepositTxVersionZeroType {
return nil, ErrDepositTxTypeNotSupported
}
err := rlp.DecodeBytes(b[2:], &inner)
err := rlp.DecodeBytes(b[1:], &inner)
return &inner, err
default:
return nil, ErrTxTypeNotSupported
Expand Down