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
16 changes: 10 additions & 6 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func deployRollupCreator(ctx context.Context, l1Reader *headerreader.HeaderReade
return rollupCreator, rollupCreatorAddress, validatorUtils, validatorWalletCreator, nil
}

func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *bind.TransactOpts, sequencer common.Address, authorizeValidators uint64, wasmModuleRoot common.Hash, chainId *big.Int, readerConfig headerreader.Config, machineConfig validator.NitroMachineConfig) (*RollupAddresses, error) {
func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *bind.TransactOpts, sequencer, rollupOwner common.Address, authorizeValidators uint64, wasmModuleRoot common.Hash, chainId *big.Int, readerConfig headerreader.Config, machineConfig validator.NitroMachineConfig) (*RollupAddresses, error) {
l1Reader := headerreader.New(l1client, readerConfig)
l1Reader.Start(ctx)
defer l1Reader.StopAndWait()
Expand Down Expand Up @@ -330,7 +330,7 @@ func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *b
StakeToken: common.Address{},
BaseStake: big.NewInt(params.Ether),
WasmModuleRoot: wasmModuleRoot,
Owner: deployAuth.From,
Owner: rollupOwner,
LoserStakeEscrow: common.Address{},
ChainId: chainId,
SequencerInboxMaxTimeVariation: seqInboxParams,
Expand All @@ -353,10 +353,14 @@ func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *b
if err != nil {
return nil, fmt.Errorf("error getting sequencer inbox: %w", err)
}
tx, err = sequencerInbox.SetIsBatchPoster(deployAuth, sequencer, true)
err = andTxSucceeded(ctx, l1Reader, tx, err)
if err != nil {
return nil, fmt.Errorf("error setting is batch poster: %w", err)

// if a zero sequencer address is specified, don't authorize any sequencers
if sequencer != (common.Address{}) {
tx, err = sequencerInbox.SetIsBatchPoster(deployAuth, sequencer, true)
err = andTxSucceeded(ctx, l1Reader, tx, err)
if err != nil {
return nil, fmt.Errorf("error setting is batch poster: %w", err)
}
}

var allowValidators []bool
Expand Down
3 changes: 2 additions & 1 deletion arbnode/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package arbnode
import (
"context"
"fmt"
"github.com/offchainlabs/nitro/util/headerreader"
"math"
"sync"
"sync/atomic"
"time"

"github.com/offchainlabs/nitro/util/headerreader"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
Expand Down
21 changes: 19 additions & 2 deletions cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func main() {
l1conn := flag.String("l1conn", "", "l1 connection")
l1keystore := flag.String("l1keystore", "", "l1 private key store")
deployAccount := flag.String("l1DeployAccount", "", "l1 seq account to use (default is first account in keystore)")
ownerAddress := flag.String("ownerAddress", "", "the rollup owner's address")
sequencerAddress := flag.String("sequencerAddress", "", "the sequencer's address")
wasmmoduleroot := flag.String("wasmmoduleroot", "", "WASM module root hash")
wasmrootpath := flag.String("wasmrootpath", "", "path to machine folders")
l1passphrase := flag.String("l1passphrase", "passphrase", "l1 private key file passphrase")
Expand Down Expand Up @@ -66,15 +68,30 @@ func main() {
panic(err)
}

if !common.IsHexAddress(*sequencerAddress) {
panic("please specify a valid sequencer address")
}
if !common.IsHexAddress(*ownerAddress) {
panic("please specify a valid rollup owner address")
}

machineConfig := validator.DefaultNitroMachineConfig
machineConfig.RootPath = *wasmrootpath

headerReaderConfig := headerreader.DefaultConfig
headerReaderConfig.TxTimeout = *txTimeout

deployPtr, err := arbnode.DeployOnL1(
ctx, l1client, l1TransactionOpts, l1TransactionOpts.From, *authorizevalidators,
common.HexToHash(*wasmmoduleroot), l2ChainId, headerReaderConfig, machineConfig,
ctx,
l1client,
l1TransactionOpts,
common.HexToAddress(*sequencerAddress),
common.HexToAddress(*ownerAddress),
*authorizevalidators,
common.HexToHash(*wasmmoduleroot),
l2ChainId,
headerReaderConfig,
machineConfig,
)
if err != nil {
flag.Usage()
Expand Down
13 changes: 12 additions & 1 deletion system_tests/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,18 @@ func DeployOnTestL1(t *testing.T, ctx context.Context, l1info info, l1client cli
l1info.PrepareTx("Faucet", "User", 30000, big.NewInt(9223372036854775807), nil)})

l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx)
addresses, err := arbnode.DeployOnL1(ctx, l1client, &l1TransactionOpts, l1info.GetAddress("Sequencer"), 0, common.Hash{}, chainId, headerreader.TestConfig, validator.DefaultNitroMachineConfig)
addresses, err := arbnode.DeployOnL1(
ctx,
l1client,
&l1TransactionOpts,
l1info.GetAddress("Sequencer"),
l1info.GetAddress("RollupOwner"),
0,
common.Hash{},
chainId,
headerreader.TestConfig,
validator.DefaultNitroMachineConfig,
)
Require(t, err)
l1info.SetContract("Bridge", addresses.Bridge)
l1info.SetContract("SequencerInbox", addresses.SequencerInbox)
Expand Down