Skip to content

Commit

Permalink
Update contracts submodule pin to latest develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Aug 2, 2023
1 parent 36ff11b commit 402164f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 35 deletions.
41 changes: 8 additions & 33 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func GenerateRollupConfig(prod bool, wasmModuleRoot common.Hash, rollupOwner com
}
}

func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *bind.TransactOpts, sequencer common.Address, authorizeValidators uint64, readerConfig headerreader.ConfigFetcher, config rollupgen.Config) (*chaininfo.RollupAddresses, error) {
func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *bind.TransactOpts, batchPoster common.Address, authorizeValidators uint64, readerConfig headerreader.ConfigFetcher, config rollupgen.Config) (*chaininfo.RollupAddresses, error) {
l1Reader, err := headerreader.New(ctx, l1client, readerConfig)
if err != nil {
return nil, err
Expand All @@ -247,9 +247,16 @@ func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *b
return nil, fmt.Errorf("error deploying rollup creator: %w", err)
}

var validatorAddrs []common.Address
for i := uint64(1); i <= authorizeValidators; i++ {
validatorAddrs = append(validatorAddrs, crypto.CreateAddress(validatorWalletCreator, i))
}

tx, err := rollupCreator.CreateRollup(
deployAuth,
config,
batchPoster,
validatorAddrs,
)
if err != nil {
return nil, fmt.Errorf("error submitting create rollup tx: %w", err)
Expand All @@ -263,38 +270,6 @@ func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *b
return nil, fmt.Errorf("error parsing rollup created log: %w", err)
}

sequencerInbox, err := bridgegen.NewSequencerInbox(info.SequencerInbox, l1client)
if err != nil {
return nil, fmt.Errorf("error getting sequencer inbox: %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
var validatorAddrs []common.Address
for i := uint64(1); i <= authorizeValidators; i++ {
validatorAddrs = append(validatorAddrs, crypto.CreateAddress(validatorWalletCreator, i))
allowValidators = append(allowValidators, true)
}
if len(validatorAddrs) > 0 {
rollup, err := rollupgen.NewRollupAdminLogic(info.RollupAddress, l1client)
if err != nil {
return nil, fmt.Errorf("error getting rollup admin: %w", err)
}
tx, err = rollup.SetValidator(deployAuth, validatorAddrs, allowValidators)
err = andTxSucceeded(ctx, l1Reader, tx, err)
if err != nil {
return nil, fmt.Errorf("error setting validator: %w", err)
}
}

return &chaininfo.RollupAddresses{
Bridge: info.Bridge,
Inbox: info.InboxAddress,
Expand Down
2 changes: 1 addition & 1 deletion contracts
Submodule contracts updated 103 files
2 changes: 1 addition & 1 deletion go-ethereum

0 comments on commit 402164f

Please sign in to comment.