Skip to content

Add initial FOCIL implementation #30914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a068aa2
beacon/engine: add `InclusionList` type
jihoonsong Feb 7, 2025
f984828
beacon/engine: add helpers for the conversion between txs and inclusi…
jihoonsong Feb 7, 2025
0b46f10
eth/catalyst, miner: add `GetInclusionListV1`
jihoonsong Nov 25, 2024
89896f8
eth/catalyst: cache recently generated inclusion lists
jihoonsong Nov 25, 2024
69c51b0
beacon/engine: add `INVALID_INCLUSION_LIST` to payload status
jihoonsong Nov 26, 2024
4026a0f
consensus/misc/eip4844, params: support eip7805 fork
jihoonsong Apr 8, 2025
90d59b8
eth/catalyst: make `forkchoiceUpdatedV3` and `newPayloadV4` available…
jihoonsong May 19, 2025
bbcade2
eth/catalyst: add `engine_newPayloadV5`
jihoonsong Nov 28, 2024
fc8588f
eth/catalyst: verify if a block satisfies the inclusion list constraints
jihoonsong Feb 25, 2025
d90735f
eth/catalyst: add an unit test for verifying new payload against incl…
jihoonsong Nov 28, 2024
bc38736
miner: add `inclusionList` to `Miner.generateParams`
jihoonsong Nov 30, 2024
f635a7e
miner: add `inclusionList` to `Miner.environment`
jihoonsong Nov 30, 2024
236aa69
miner: include inclusion list transactions when building a payload
jihoonsong Nov 30, 2024
a5701a6
miner: add a public method to notify the inclusion list to payload
jihoonsong Nov 30, 2024
d3bfb8d
eth/catalyst: add `peek` method to `payloadQueue` to return `Miner.Pa…
jihoonsong Nov 30, 2024
c5b634e
eth/catalyst: add `engine_updatePayloadWithInclusionListV1`
jihoonsong Nov 30, 2024
9f03028
eth/catalyst: add an unit test for updating payload with inclusion list
jihoonsong Nov 30, 2024
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
4 changes: 4 additions & 0 deletions beacon/engine/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ var (
// - newPayloadV1: if the payload was accepted, but not processed (side chain)
ACCEPTED = "ACCEPTED"

// INVALID_INCLUSION_LIST is returned by the engine API in the following calls:
// - newPayloadV5: if the payload failed to satisfy the inclusion list constraints
INVALID_INCLUSION_LIST = "INVALID_INCLUSION_LIST"

GenericServerError = &EngineAPIError{code: -32000, msg: "Server error"}
UnknownPayload = &EngineAPIError{code: -38001, msg: "Unknown payload"}
InvalidForkChoiceState = &EngineAPIError{code: -38002, msg: "Invalid forkchoice state"}
Expand Down
40 changes: 40 additions & 0 deletions beacon/engine/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package engine

import (
"encoding/json"
"fmt"
"math/big"
"slices"
Expand Down Expand Up @@ -350,6 +351,45 @@ type ExecutionPayloadBody struct {
Withdrawals []*types.Withdrawal `json:"withdrawals"`
}

// InclusionList is a list of transactions that should be included in a payload.
type InclusionList [][]byte

func (inclusionList InclusionList) MarshalJSON() ([]byte, error) {
inclusionListHex := make([]hexutil.Bytes, len(inclusionList))
for i, tx := range inclusionList {
inclusionListHex[i] = tx
}

return json.Marshal(inclusionListHex)
}

func (inclusionList *InclusionList) UnmarshalJSON(input []byte) error {
var inclusionListHex []hexutil.Bytes
if err := json.Unmarshal(input, &inclusionListHex); err != nil {
return err
}

*inclusionList = make([][]byte, len(inclusionListHex))
for i, tx := range inclusionListHex {
(*inclusionList)[i] = tx
}

return nil
}

func InclusionListToTransactions(inclusionList InclusionList) ([]*types.Transaction, error) {
txs, err := decodeTransactions(inclusionList)
if err != nil {
return nil, err
}

return txs, nil
}

func TransactionsToInclusionList(txs []*types.Transaction) InclusionList {
return encodeTransactions(txs)
}

// Client identifiers to support ClientVersionV1.
const (
ClientCode = "GE"
Expand Down
3 changes: 3 additions & 0 deletions consensus/misc/eip4844/eip4844.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
var frac uint64
switch config.LatestFork(header.Time) {
case forks.Eip7805:
// EIP7805 fork is a transient fork so it piggy backs on an existing canonical fork's config.
frac = config.BlobScheduleConfig.Prague.UpdateFraction
case forks.Osaka:
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
case forks.Prague:
Expand Down
Loading