Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: docker-pr

on:
pull_request:
branches:
- "covalent"
branches:
- "covalent"

jobs:
deploy-test:
Expand All @@ -22,4 +22,4 @@ jobs:
# continue-on-error: true
- name: Build & Publish the Docker image
run: |
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --file ./Dockerfile-evm --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/evm-server:latest --push
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --file ./Dockerfile-evm --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/evm-server:latest --push
3 changes: 3 additions & 0 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type stEnv struct {
BlobGasUsed *uint64 `json:"blobGasUsed" rlp:"optional"`
ExcessBlobGas *uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *libcommon.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *libcommon.Hash `json:"requestsHash" rlp:"optional"`
}

type stEnvMarshaling struct {
Expand All @@ -79,6 +80,7 @@ type stEnvMarshaling struct {
BlobGasUsed *math.HexOrDecimal64
ExcessBlobGas *math.HexOrDecimal64
ParentBeaconRoot *libcommon.Address
RequestsHash *libcommon.Address
}

func (stEnv *stEnv) loadFromReplica(replica *BlockReplica) {
Expand All @@ -88,6 +90,7 @@ func (stEnv *stEnv) loadFromReplica(replica *BlockReplica) {
stEnv.Number = replica.Header.Number.Uint64()
stEnv.Timestamp = replica.Header.Time
stEnv.BlockHashes = make(map[math.HexOrDecimal64]libcommon.Hash)
stEnv.RequestsHash = replica.Header.RequestsHash
for _, blockhash := range replica.State.BlockhashRead {
stEnv.BlockHashes[math.HexOrDecimal64(blockhash.BlockNumber)] = blockhash.BlockHash
}
Expand Down
84 changes: 66 additions & 18 deletions cmd/evm/internal/t8ntool/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type BlockReplica struct {
State *StateSpecimen `json:"State"`
Withdrawals []*Withdrawal
BlobTxSidecars []*BlobTxSidecar
RequestsHash *libcommon.Hash
}

type Withdrawal struct {
Expand Down Expand Up @@ -98,27 +99,30 @@ type Header struct {
BlobGasUsed *uint64 `json:"blobGasUsed" rlp:"optional"`
ExcessBlobGas *uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *libcommon.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *libcommon.Hash `json:"requestsHash" rlp:"optional"`
}

type Transaction struct {
Type byte `json:"type"`
AccessList types.AccessList `json:"accessList"`
ChainId *BigInt `json:"chainId"`
AccountNonce uint64 `json:"nonce"`
Price *BigInt `json:"gasPrice"`
GasLimit uint64 `json:"gas"`
GasTipCap *BigInt `json:"gasTipCap"`
GasFeeCap *BigInt `json:"gasFeeCap"`
Sender *libcommon.Address `json:"from"`
Recipient *libcommon.Address `json:"to" rlp:"nil"` // nil means contract creation
Amount *BigInt `json:"value"`
Payload []byte `json:"input"`
V *BigInt `json:"v"`
R *BigInt `json:"r"`
S *BigInt `json:"s"`
BlobFeeCap *BigInt `json:"blobFeeCap" rlp:"optional"`
BlobHashes []libcommon.Hash `json:"blobHashes" rlp:"optional"`
BlobGas uint64 `json:"blobGas" rlp:"optional"`
Type byte `json:"type"`
AccessList types.AccessList `json:"accessList"`
ChainId *BigInt `json:"chainId"`
AccountNonce uint64 `json:"nonce"`
Price *BigInt `json:"gasPrice"`
GasLimit uint64 `json:"gas"`
GasTipCap *BigInt `json:"gasTipCap"`
GasFeeCap *BigInt `json:"gasFeeCap"`
Sender *libcommon.Address `json:"from"`
Recipient *libcommon.Address `json:"to" rlp:"nil"` // nil means contract creation
Amount *BigInt `json:"value"`
Payload []byte `json:"input"`
V *BigInt `json:"v"`
R *BigInt `json:"r"`
S *BigInt `json:"s"`
BlobFeeCap *BigInt `json:"blobFeeCap" rlp:"optional"`
BlobHashes []libcommon.Hash `json:"blobHashes" rlp:"optional"`
BlobGas uint64 `json:"blobGas" rlp:"optional"`
Data []byte `rlp:"optional"`
AuthList []types2.Authorization `rlp:"optional"`
}

type Logs struct {
Expand Down Expand Up @@ -193,6 +197,7 @@ func adaptHeader(header *types2.Header) (*Header, error) {
BlobGasUsed: header.BlobGasUsed,
ExcessBlobGas: header.ExcessBlobGas,
ParentBeaconRoot: header.ParentBeaconBlockRoot,
RequestsHash: header.RequestsHash,
}, nil
}

Expand All @@ -206,6 +211,7 @@ func copyMissingHashesFromReplica(header *Header, inputReplica *BlockReplica) {
header.BlobGasUsed = inputReplica.Header.BlobGasUsed
header.ExcessBlobGas = inputReplica.Header.ExcessBlobGas
header.ParentBeaconRoot = inputReplica.Header.ParentBeaconRoot
header.RequestsHash = inputReplica.Header.RequestsHash
}

func (tx *Transaction) adaptTransaction() (types2.Transaction, error) {
Expand Down Expand Up @@ -344,6 +350,48 @@ func (tx *Transaction) adaptTransaction() (types2.Transaction, error) {
setSignatureValues(&blobTx.DynamicFeeTransaction.CommonTx, tx.V, tx.R, tx.S)
return &blobTx, nil

case types.SetCodeTxType:
var tip *uint256.Int
var feeCap *uint256.Int
if tx.GasTipCap != nil {
tip, overflow = uint256.FromBig((*big.Int)(tx.GasTipCap.Int))
if overflow {
return nil, fmt.Errorf("GasTipCap field caused an overflow (uint256)")
}
}

if tx.GasFeeCap != nil {
feeCap, overflow = uint256.FromBig((*big.Int)(tx.GasFeeCap.Int))
if overflow {
return nil, fmt.Errorf("GasTipCap field caused an overflow (uint256)")
}
}

dynamicFeeTx := types2.DynamicFeeTransaction{
CommonTx: types2.CommonTx{
Nonce: uint64(tx.AccountNonce),
To: tx.Recipient,
Value: value,
Gas: uint64(tx.GasLimit),
Data: tx.Payload,
},
ChainID: chainId,
Tip: tip,
FeeCap: feeCap,
AccessList: tx.AccessList,
}

setCodeTx := types2.SetCodeTransaction{
DynamicFeeTransaction: dynamicFeeTx,
Authorizations: tx.AuthList,
}

if tx.Sender != nil {
setCodeTx.DynamicFeeTransaction.CommonTx.SetFrom(*tx.Sender)
}
setSignatureValues(&setCodeTx.DynamicFeeTransaction.CommonTx, tx.V, tx.R, tx.S)
return &setCodeTx, nil

default:
return nil, nil

Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
const (
EvmServerVersionMajor = 1
EvmServerVersionMinor = 3
EvmServerVersionPatch = 2
EvmServerVersionPatch = 3
clientIdentifier = "evm-server" // Client identifier to advertise over the network
)

Expand Down
6 changes: 3 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ func ExecuteBlockEphemerally(
return nil, fmt.Errorf("gas used by execution: %d, in header: %d", *usedGas, header.GasUsed)
}

if header.BlobGasUsed != nil && *usedBlobGas != *header.BlobGasUsed {
return nil, fmt.Errorf("blob gas used by execution: %d, in header: %d", *usedBlobGas, *header.BlobGasUsed)
}
// if header.BlobGasUsed != nil && *usedBlobGas != *header.BlobGasUsed {
// return nil, fmt.Errorf("blob gas used by execution: %d, in header: %d", *usedBlobGas, *header.BlobGasUsed)
// }

var bloom types.Bloom
if !vmConfig.NoReceipts {
Expand Down
1 change: 1 addition & 0 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type Header struct {
ExcessBlobGas *uint64 `json:"excessBlobGas"`

ParentBeaconBlockRoot *libcommon.Hash `json:"parentBeaconBlockRoot"` // EIP-4788
RequestsHash *libcommon.Hash `json:"requestsHash"` // EIP-4844

// The verkle proof is ignored in legacy headers
Verkle bool
Expand Down
1 change: 1 addition & 0 deletions erigon-lib/types/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const (
AccessListTxType byte = 1 // EIP-2930
DynamicFeeTxType byte = 2 // EIP-1559
BlobTxType byte = 3 // EIP-4844
SetCodeTxType byte = 4 // EIP-7702
)

var ErrParseTxn = fmt.Errorf("%w transaction", rlp.ErrParse)
Expand Down
Loading