Skip to content

Commit

Permalink
Use upstream contracts submodule
Browse files Browse the repository at this point in the history
We no longer need the customizations in nitro-contracts (except
potentially some deployment tools) so this commit resets it to the
before the celestia contracts were added

celestiaorg/nitro-contracts@4f8c65c

and makes the nitro code work with that version by removing the hotshot
/ light client address passed to the OSP.
  • Loading branch information
sveitser committed Nov 15, 2024
1 parent 8c92ada commit ecd0087
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
3 changes: 0 additions & 3 deletions cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func main() {
authorizevalidators := flag.Uint64("authorizevalidators", 0, "Number of validators to preemptively authorize")
txTimeout := flag.Duration("txtimeout", 10*time.Minute, "Timeout when waiting for a transaction to be included in a block")
prod := flag.Bool("prod", false, "Whether to configure the rollup for production or testing")
hotshotAddr := flag.String("hotshot", "", "the address of hotshot contract in L1")
flag.Parse()
l1ChainId := new(big.Int).SetUint64(*l1ChainIdUint)
maxDataSize := new(big.Int).SetUint64(*maxDataSizeUint)
Expand Down Expand Up @@ -180,7 +179,6 @@ func main() {
defer l1Reader.StopAndWait()

nativeToken := common.HexToAddress(*nativeTokenAddressString)
hotshot := common.HexToAddress(*hotshotAddr)
deployedAddresses, err := deploycode.DeployOnParentChain(
ctx,
l1Reader,
Expand All @@ -192,7 +190,6 @@ func main() {
nativeToken,
maxDataSize,
true,
hotshot,
)
if err != nil {
flag.Usage()
Expand Down
2 changes: 1 addition & 1 deletion contracts
Submodule contracts updated 41 files
+0 −3 .env.sample.goerli
+1 −5 .github/workflows/contract-tests.yml
+0 −25 .github/workflows/espresso-release.yml
+1 −3 .gitignore
+0 −5 CODEOWNERS
+1 −1 LICENSE.md
+11 −31 README.md
+0 −26 espresso-deployments/sepolia.json
+0 −111 flake.lock
+0 −39 flake.nix
+1 −1 foundry.toml
+1 −21 hardhat.config.ts
+3 −3 package.json
+1 −1 scripts/config.ts.example
+4 −49 scripts/deployment.ts
+2 −15 scripts/deploymentUtils.ts
+0 −10 scripts/espresso-build-release
+1 −6 scripts/local-deployment/deployCreatorAndCreateRollup.ts
+1 −1 slither.db.json
+0 −15 src/bridge/IHotShot.sol
+0 −142 src/express-lane-auction/Balance.sol
+0 −25 src/express-lane-auction/Burner.sol
+0 −73 src/express-lane-auction/ELCRound.sol
+0 −31 src/express-lane-auction/Errors.sol
+0 −565 src/express-lane-auction/ExpressLaneAuction.sol
+0 −421 src/express-lane-auction/IExpressLaneAuction.sol
+0 −115 src/express-lane-auction/RoundTimingInfo.sol
+0 −42 src/mocks/CreateTest.sol
+0 −196 src/mocks/HostioTest.sol
+1 −2 src/osp/OneStepProofEntry.sol
+1 −106 src/osp/OneStepProverHostIo.sol
+1 −2 src/precompiles/ArbSys.sol
+0 −3 src/state/Instructions.sol
+0 −38 src/test-helpers/HotShot.sol
+7 −24 test/e2e/orbitChain.ts
+0 −2,385 test/foundry/ExpressLaneAuction.t.sol
+0 −221 test/foundry/ExpressLaneBalance.t.sol
+0 −49 test/foundry/ExpressLaneBurner.t.sol
+0 −152 test/foundry/ExpressLaneELCRound.t.sol
+0 −343 test/foundry/ExpressLaneRoundTiming.t.sol
+1 −14 test/foundry/RollupCreator.t.sol
12 changes: 6 additions & 6 deletions deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func deployBridgeCreator(ctx context.Context, parentChainReader *headerreader.He
return bridgeCreatorAddr, nil
}

func deployChallengeFactory(ctx context.Context, parentChainReader *headerreader.HeaderReader, auth *bind.TransactOpts, hotshot common.Address) (common.Address, common.Address, error) {
func deployChallengeFactory(ctx context.Context, parentChainReader *headerreader.HeaderReader, auth *bind.TransactOpts) (common.Address, common.Address, error) {
client := parentChainReader.Client()
osp0, tx, _, err := ospgen.DeployOneStepProver0(auth, client)
err = andTxSucceeded(ctx, parentChainReader, tx, err)
Expand All @@ -148,7 +148,7 @@ func deployChallengeFactory(ctx context.Context, parentChainReader *headerreader
return common.Address{}, common.Address{}, fmt.Errorf("ospMath deploy error: %w", err)
}

ospHostIo, tx, _, err := ospgen.DeployOneStepProverHostIo(auth, client, hotshot)
ospHostIo, tx, _, err := ospgen.DeployOneStepProverHostIo(auth, client)
err = andTxSucceeded(ctx, parentChainReader, tx, err)
if err != nil {
return common.Address{}, common.Address{}, fmt.Errorf("ospHostIo deploy error: %w", err)
Expand All @@ -169,13 +169,13 @@ func deployChallengeFactory(ctx context.Context, parentChainReader *headerreader
return ospEntryAddr, challengeManagerAddr, nil
}

func deployRollupCreator(ctx context.Context, parentChainReader *headerreader.HeaderReader, auth *bind.TransactOpts, maxDataSize *big.Int, chainSupportsBlobs bool, hotshot common.Address) (*rollupgen.RollupCreator, common.Address, common.Address, common.Address, error) {
func deployRollupCreator(ctx context.Context, parentChainReader *headerreader.HeaderReader, auth *bind.TransactOpts, maxDataSize *big.Int, chainSupportsBlobs bool) (*rollupgen.RollupCreator, common.Address, common.Address, common.Address, error) {
bridgeCreator, err := deployBridgeCreator(ctx, parentChainReader, auth, maxDataSize, chainSupportsBlobs)
if err != nil {
return nil, common.Address{}, common.Address{}, common.Address{}, fmt.Errorf("bridge creator deploy error: %w", err)
}

ospEntryAddr, challengeManagerAddr, err := deployChallengeFactory(ctx, parentChainReader, auth, hotshot)
ospEntryAddr, challengeManagerAddr, err := deployChallengeFactory(ctx, parentChainReader, auth)
if err != nil {
return nil, common.Address{}, common.Address{}, common.Address{}, err
}
Expand Down Expand Up @@ -242,12 +242,12 @@ func deployRollupCreator(ctx context.Context, parentChainReader *headerreader.He
return rollupCreator, rollupCreatorAddress, validatorUtils, validatorWalletCreator, nil
}

func DeployOnParentChain(ctx context.Context, parentChainReader *headerreader.HeaderReader, deployAuth *bind.TransactOpts, batchPosters []common.Address, batchPosterManager common.Address, authorizeValidators uint64, config rollupgen.Config, nativeToken common.Address, maxDataSize *big.Int, chainSupportsBlobs bool, hotshot common.Address) (*chaininfo.RollupAddresses, error) {
func DeployOnParentChain(ctx context.Context, parentChainReader *headerreader.HeaderReader, deployAuth *bind.TransactOpts, batchPosters []common.Address, batchPosterManager common.Address, authorizeValidators uint64, config rollupgen.Config, nativeToken common.Address, maxDataSize *big.Int, chainSupportsBlobs bool) (*chaininfo.RollupAddresses, error) {
if config.WasmModuleRoot == (common.Hash{}) {
return nil, errors.New("no machine specified")
}

rollupCreator, _, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, parentChainReader, deployAuth, maxDataSize, chainSupportsBlobs, hotshot)
rollupCreator, _, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, parentChainReader, deployAuth, maxDataSize, chainSupportsBlobs)
if err != nil {
return nil, fmt.Errorf("error deploying rollup creator: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion staker/challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func DeployOneStepProofEntry(t *testing.T, auth *bind.TransactOpts, client bind.
ospMath, _, _, err := ospgen.DeployOneStepProverMath(auth, client)
Require(t, err)

ospHostIo, _, _, err := ospgen.DeployOneStepProverHostIo(auth, client, common.Address{})
ospHostIo, _, _, err := ospgen.DeployOneStepProverHostIo(auth, client)
Require(t, err)

ospEntry, _, _, err := ospgen.DeployOneStepProofEntry(auth, client, osp0, ospMem, ospMath, ospHostIo)
Expand Down
4 changes: 0 additions & 4 deletions system_tests/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ func (b *NodeBuilder) BuildL1(t *testing.T) {
locator.LatestWasmModuleRoot(),
b.withProdConfirmPeriodBlocks,
true,
common.Address{},
)
b.L1.cleanup = func() { requireClose(t, b.L1.Stack) }
}
Expand Down Expand Up @@ -507,7 +506,6 @@ func (b *NodeBuilder) BuildL3OnL2(t *testing.T) func() {
locator.LatestWasmModuleRoot(),
b.l3Config.withProdConfirmPeriodBlocks,
false,
common.Address{},
)

b.L3 = buildOnParentChain(
Expand Down Expand Up @@ -1246,7 +1244,6 @@ func deployOnParentChain(
wasmModuleRoot common.Hash,
prodConfirmPeriodBlocks bool,
chainSupportsBlobs bool,
hotshotAddr common.Address,
) (*chaininfo.RollupAddresses, *arbostypes.ParsedInitMessage) {
parentChainInfo.GenerateAccount("RollupOwner")
parentChainInfo.GenerateAccount("Sequencer")
Expand Down Expand Up @@ -1282,7 +1279,6 @@ func deployOnParentChain(
nativeToken,
maxDataSize,
chainSupportsBlobs,
hotshotAddr,
)
Require(t, err)
parentChainInfo.SetContract("Bridge", addresses.Bridge)
Expand Down
6 changes: 3 additions & 3 deletions system_tests/full_challenge_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/offchainlabs/nitro/validator/server_common"
)

func DeployOneStepProofEntry(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, hotshot common.Address) common.Address {
func DeployOneStepProofEntry(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) common.Address {
osp0, tx, _, err := ospgen.DeployOneStepProver0(auth, client)
Require(t, err)
_, err = EnsureTxSucceeded(ctx, client, tx)
Expand All @@ -53,7 +53,7 @@ func DeployOneStepProofEntry(t *testing.T, ctx context.Context, auth *bind.Trans
_, err = EnsureTxSucceeded(ctx, client, tx)
Require(t, err)

ospHostIo, tx, _, err := ospgen.DeployOneStepProverHostIo(auth, client, hotshot)
ospHostIo, tx, _, err := ospgen.DeployOneStepProverHostIo(auth, client)
Require(t, err)
_, err = EnsureTxSucceeded(ctx, client, tx)
Require(t, err)
Expand Down Expand Up @@ -330,7 +330,7 @@ func RunChallengeTest(t *testing.T, asserterIsCorrect bool, useStubs bool, chall
trueDelayedBridge = asserterBridgeAddr
expectedWinner = l1Info.GetAddress("asserter")
}
ospEntry := DeployOneStepProofEntry(t, ctx, &deployerTxOpts, l1Backend, common.Address{})
ospEntry := DeployOneStepProofEntry(t, ctx, &deployerTxOpts, l1Backend)

var wasmModuleRoot common.Hash
if useStubs {
Expand Down

0 comments on commit ecd0087

Please sign in to comment.