-
Notifications
You must be signed in to change notification settings - Fork 2
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
engine-api support #5
engine-api support #5
Conversation
d5ae9f3
to
eaf968a
Compare
@ujvl ready for review I added an Right now, I also cleaned up how we disable the ConsensusAPI heartbeat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What does Optimism's
RollupComputePendingBlock
option mean? Why don't we need it? - Can you explain several inconsistent changes w/ optimism:
- The signature of
getSealingBlock
is different. Is this caused by different geth versions?
beacon/engine/types.go
Outdated
Random common.Hash `json:"prevRandao" gencodec:"required"` | ||
SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient" gencodec:"required"` | ||
// <specular modification> | ||
Withdrawals []*types.Withdrawal `json:"withdrawals,omitempty" gencodec:"optional"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it is marked as optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have the same q
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added this by mistake, fixed
if err != nil { | ||
return nil, err | ||
} | ||
// Construct a payload object for return. | ||
payload := newPayload(empty, args.Id()) | ||
// <specular modification> | ||
if args.NoTxPool { // don't start the background payload updating job if there is no tx pool to pull from | ||
return payload, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to mark as full here? ref https://github.com/ethereum-optimism/op-geth/blob/optimism/miner/payload_building.go#L221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
miner/worker.go
Outdated
header.Extra = w.extra | ||
} | ||
// <specular modification> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing /
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
params/config.go
Outdated
@@ -304,6 +304,9 @@ type ChainConfig struct { | |||
Ethash *EthashConfig `json:"ethash,omitempty"` | |||
Clique *CliqueConfig `json:"clique,omitempty"` | |||
IsDevMode bool `json:"isDev,omitempty"` | |||
// <specular modification> | |||
L2EngineApi bool `json:"l2EngineApi,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit rename to
L2EngineApi bool `json:"l2EngineApi,omitempty"` | |
EnableL2EngineAPI bool `json:"l2EngineApi,omitempty"` |
miner/worker_test.go
Outdated
@@ -468,7 +470,9 @@ func testGetSealingWork(t *testing.T, chainConfig *params.ChainConfig, engine co | |||
// This API should work even when the automatic sealing is enabled | |||
w.start() | |||
for _, c := range cases { | |||
block, _, err := w.getSealingBlock(c.parent, timestamp, c.coinbase, c.random, nil, false) | |||
// <specular modification> | |||
block, _, err := w.getSealingBlock(c.parent, timestamp, c.coinbase, c.random, nil, false, nil, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be misreading but is this setting a bool to nil (2nd to last param)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was actually passing an extra param. I did run make test
to confirm all the tests pass but it must not have built this file. I'll look into how to actually build and run this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we update to the latest geth, the new getSealingBlock
api means we can eliminate the specular diff in this file.
beacon/engine/types.go
Outdated
Random common.Hash `json:"prevRandao" gencodec:"required"` | ||
SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient" gencodec:"required"` | ||
// <specular modification> | ||
Withdrawals []*types.Withdrawal `json:"withdrawals,omitempty" gencodec:"optional"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have the same q
|
EnableL2EngineApiFlag = &cli.BoolFlag{ | ||
Name: "enableL2EngineApi", | ||
Usage: "Enable L2 Engine API", | ||
Category: flags.EthCategory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't sure if this should go in the miner catagory instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eth is good for now
5d76f54
to
8e35e3a
Compare
8e35e3a
to
ebc427e
Compare
ebc427e
to
c92471a
Compare
c92471a
to
c8eb311
Compare
c8eb311
to
50901bb
Compare
This PR adds support to specular-geth to support deterministic execution of transactions via the engine-api.
To support this we need to make a few changes to geth:
PayloadAttributes
withTransactions
, a list of transaction to force include in the blockPayloadAttributes
withNoTxPool
, if true no transactions are taken out of the tx-pool, only transactions from the aboveTransactions
list will be included. to validate existing blocks we will exclude transactions from the mempool, to sequence new blocks we will include transactions from the mempool.Specular changes differ from optimism/superchain engine-api spec, because we don't use deposit/system transactions:
https://op-geth.optimism.io/
https://github.com/ethereum-optimism/optimism/blob/develop/specs/exec-engine.md#engine-api