Skip to content
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

[Configuration Changes] Execution service 3: initial execution-node, interface+implementation #1537

Merged
merged 41 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2afb28b
execnode - initial, only build passes
tsahee Mar 9, 2023
9b54f49
move maintenance to gethclient
tsahee Mar 15, 2023
97ff212
update geth
tsahee Mar 15, 2023
4a70e05
improve execution-consensus separation
tsahee Mar 15, 2023
444cef1
rename gethclient to gethexec
tsahee Mar 15, 2023
8f6ef39
execnode: small fixes
tsahee Mar 15, 2023
bb797fd
update geth
tsahee Mar 15, 2023
caa4823
execution service - fix tests
tsahee Mar 15, 2023
f7c611f
update geth
tsahee Mar 15, 2023
28bf4ee
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Mar 25, 2023
a7984e2
gethexec: dont break if sequencer is nil
tsahee Mar 25, 2023
b2e298f
fix redis tests compilation
tsahee Mar 25, 2023
ecd77c0
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Mar 26, 2023
92296a0
delayed_seq uses ExecutionSequencer
tsahee Mar 29, 2023
12e21cb
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Mar 30, 2023
4561fca
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Apr 19, 2023
6c332b2
sync_monitor: remove blockNum
tsahee Apr 19, 2023
7678cd7
execnode L1 reader
tsahee Apr 19, 2023
a6aeffa
fix merge errors
tsahee Apr 19, 2023
9bc1566
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Apr 30, 2023
f28de1a
fix merge problems
tsahee Apr 30, 2023
ec50a17
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee May 9, 2023
3176ffa
Merge branch 'rpcclient' into execution-service-3
tsahee May 9, 2023
fbc9f6e
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee May 11, 2023
85d6480
update headerreader API
tsahee May 11, 2023
bf67b36
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee May 26, 2023
29675e8
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Jun 14, 2023
ed4cd44
fix merge
tsahee Jun 15, 2023
f994845
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Jun 27, 2023
a5434ad
remove unused sequencer.dangerous config
tsahee Jun 27, 2023
8a37efe
Merge branch 'execution-separate-over-valiation' into execution-servi…
tsahee Jun 27, 2023
36d3bca
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Jul 10, 2023
6981654
fix merge errors
tsahee Jul 10, 2023
6db79ae
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Sep 26, 2023
6a9e0c2
fix merge errors
tsahee Sep 26, 2023
4d04419
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Sep 27, 2023
5a4d987
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Sep 27, 2023
0e7ddcc
fix review comments
tsahee Sep 28, 2023
294343b
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Sep 28, 2023
60a5b41
Merge remote-tracking branch 'origin/master' into execution-service-3
tsahee Oct 4, 2023
e09ddd6
update geth: for PR review
tsahee Oct 4, 2023
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: 1 addition & 3 deletions arbnode/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/staker"
"github.com/offchainlabs/nitro/validator"
Expand All @@ -23,8 +22,7 @@ func (a *BlockValidatorAPI) LatestValidated(ctx context.Context) (*staker.Global
}

type BlockValidatorDebugAPI struct {
val *staker.StatelessBlockValidator
blockchain *core.BlockChain
val *staker.StatelessBlockValidator
}

type ValidateBlockResult struct {
Expand Down
6 changes: 3 additions & 3 deletions arbnode/delayed_sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/ethereum/go-ethereum/log"
flag "github.com/spf13/pflag"

"github.com/offchainlabs/nitro/arbnode/execution"
"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/execution"
"github.com/offchainlabs/nitro/util/headerreader"
"github.com/offchainlabs/nitro/util/stopwaiter"
)
Expand All @@ -26,7 +26,7 @@ type DelayedSequencer struct {
l1Reader *headerreader.HeaderReader
bridge *DelayedBridge
inbox *InboxTracker
exec *execution.ExecutionEngine
exec execution.ExecutionSequencer
coordinator *SeqCoordinator
waitingForFinalizedBlock uint64
mutex sync.Mutex
Expand Down Expand Up @@ -63,7 +63,7 @@ var TestDelayedSequencerConfig = DelayedSequencerConfig{
UseMergeFinality: true,
}

func NewDelayedSequencer(l1Reader *headerreader.HeaderReader, reader *InboxReader, exec *execution.ExecutionEngine, coordinator *SeqCoordinator, config DelayedSequencerConfigFetcher) (*DelayedSequencer, error) {
func NewDelayedSequencer(l1Reader *headerreader.HeaderReader, reader *InboxReader, exec execution.ExecutionSequencer, coordinator *SeqCoordinator, config DelayedSequencerConfigFetcher) (*DelayedSequencer, error) {
d := &DelayedSequencer{
l1Reader: l1Reader,
bridge: reader.DelayedBridge(),
Expand Down
90 changes: 0 additions & 90 deletions arbnode/execution/node.go

This file was deleted.

20 changes: 15 additions & 5 deletions arbnode/inbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"
"time"

"github.com/offchainlabs/nitro/arbnode/execution"
"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/arbos/l2pricing"
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/execution/gethexec"
"github.com/offchainlabs/nitro/statetransfer"

"github.com/offchainlabs/nitro/util/arbmath"
Expand All @@ -30,7 +30,16 @@ import (
"github.com/offchainlabs/nitro/arbos"
)

func NewTransactionStreamerForTest(t *testing.T, ownerAddress common.Address) (*execution.ExecutionEngine, *TransactionStreamer, ethdb.Database, *core.BlockChain) {
type execClientWrapper struct {
*gethexec.ExecutionEngine
t *testing.T
}

func (w *execClientWrapper) Pause() { w.t.Error("not supported") }
func (w *execClientWrapper) Activate() { w.t.Error("not supported") }
func (w *execClientWrapper) ForwardTo(url string) error { w.t.Error("not supported"); return nil }

func NewTransactionStreamerForTest(t *testing.T, ownerAddress common.Address) (*gethexec.ExecutionEngine, *TransactionStreamer, ethdb.Database, *core.BlockChain) {
chainConfig := params.ArbitrumDevTestChainConfig()

initData := statetransfer.ArbosInitializationInfo{
Expand All @@ -46,18 +55,19 @@ func NewTransactionStreamerForTest(t *testing.T, ownerAddress common.Address) (*
arbDb := rawdb.NewMemoryDatabase()
initReader := statetransfer.NewMemoryInitDataReader(&initData)

bc, err := execution.WriteOrTestBlockChain(chainDb, nil, initReader, chainConfig, arbostypes.TestInitMessage, ConfigDefaultL2Test().TxLookupLimit, 0)
bc, err := gethexec.WriteOrTestBlockChain(chainDb, nil, initReader, chainConfig, arbostypes.TestInitMessage, gethexec.ConfigDefaultTest().TxLookupLimit, 0)

if err != nil {
Fail(t, err)
}

transactionStreamerConfigFetcher := func() *TransactionStreamerConfig { return &DefaultTransactionStreamerConfig }
execEngine, err := execution.NewExecutionEngine(bc)
execEngine, err := gethexec.NewExecutionEngine(bc)
if err != nil {
Fail(t, err)
}
inbox, err := NewTransactionStreamer(arbDb, bc.Config(), execEngine, nil, make(chan error, 1), transactionStreamerConfigFetcher)
execSeq := &execClientWrapper{execEngine, t}
inbox, err := NewTransactionStreamer(arbDb, bc.Config(), execSeq, nil, make(chan error, 1), transactionStreamerConfigFetcher)
if err != nil {
Fail(t, err)
}
Expand Down
18 changes: 14 additions & 4 deletions arbnode/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/offchainlabs/nitro/arbnode/redislock"
"github.com/offchainlabs/nitro/execution"
"github.com/offchainlabs/nitro/util/stopwaiter"
flag "github.com/spf13/pflag"
)
Expand All @@ -21,6 +22,7 @@ import (
type MaintenanceRunner struct {
stopwaiter.StopWaiter

exec execution.FullExecutionClient
config MaintenanceConfigFetcher
seqCoordinator *SeqCoordinator
dbs []ethdb.Database
Expand Down Expand Up @@ -82,12 +84,13 @@ var DefaultMaintenanceConfig = MaintenanceConfig{

type MaintenanceConfigFetcher func() *MaintenanceConfig

func NewMaintenanceRunner(config MaintenanceConfigFetcher, seqCoordinator *SeqCoordinator, dbs []ethdb.Database) (*MaintenanceRunner, error) {
func NewMaintenanceRunner(config MaintenanceConfigFetcher, seqCoordinator *SeqCoordinator, dbs []ethdb.Database, exec execution.FullExecutionClient) (*MaintenanceRunner, error) {
cfg := config()
if err := cfg.Validate(); err != nil {
return nil, fmt.Errorf("validating config: %w", err)
}
res := &MaintenanceRunner{
exec: exec,
config: config,
seqCoordinator: seqCoordinator,
dbs: dbs,
Expand Down Expand Up @@ -167,15 +170,22 @@ func (mr *MaintenanceRunner) maybeRunMaintenance(ctx context.Context) time.Durat
func (mr *MaintenanceRunner) runMaintenance() {
log.Info("Compacting databases (this may take a while...)")
results := make(chan error, len(mr.dbs))
expected := 0
for _, db := range mr.dbs {
expected++
db := db
go func() {
results <- db.Compact(nil, nil)
}()
}
for range mr.dbs {
if err := <-results; err != nil {
log.Warn("Failed to compact database", "err", err)
expected++
go func() {
results <- mr.exec.Maintenance()
}()
for i := 0; i < expected; i++ {
err := <-results
if err != nil {
log.Warn("maintenance error", "err", err)
}
}
log.Info("Done compacting databases")
Expand Down
Loading
Loading