Skip to content
Closed
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
1 change: 1 addition & 0 deletions espresso/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ const HOTSHOT_BLOCK_LOAD_LIMIT = 100
// HOTSHOT_BLOCK_LOAD_LIMIT blocks ahead or the current block height, whichever
// is smaller.
func (s *EspressoStreamer[B]) computeEspressoBlockHeightsRange(currentBlockHeight uint64) (start uint64, finish uint64) {
log.Info("computeEspressoBlockHeightsRange", "hotShotPos", s.hotShotPos, "currentBlockHeight", currentBlockHeight)
start = s.hotShotPos
if start > 0 {
// We've already processed the block in hotShotPos. In order to avoid
Expand Down
10 changes: 5 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
inputs.foundry.overlay
];

go_1_22_7 = pkgs.go_1_22.overrideAttrs (oldAttrs: rec {
version = "1.22.7";
go_1_22_10 = pkgs.go_1_22.overrideAttrs (oldAttrs: rec {
version = "1.22.10";

src = pkgs.fetchurl {
url = "https://go.dev/dl/go1.22.7.src.tar.gz";
sha256 = "sha256-ZkMth9heDPrD7f/mN9WTD8Td9XkzE/4R5KDzMwI8h58=";
url = "https://go.dev/dl/go1.22.10.src.tar.gz";
sha256 = "sha256-HpT9SL51DR+vtNmztt0xpunSc10zm/JGK8l7ZMpMEDc=";
};
});

Expand Down Expand Up @@ -95,7 +95,7 @@
pkgs.python311
pkgs.foundry-bin
pkgs.just
go_1_22_7
go_1_22_10
pkgs.gotools
pkgs.go-ethereum
pkgs.golangci-lint
Expand Down
84 changes: 84 additions & 0 deletions kurtosis-devnet/celo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
optimism_package:
chains:
- participants:
- el_type: op-geth
el_image: ""
el_log_level: ""
el_extra_env_vars: {}
el_extra_labels: {}
el_extra_params: []
el_tolerations: []
el_volume_size: 0
el_min_cpu: 0
el_max_cpu: 0
el_min_mem: 0
el_max_mem: 0
cl_type: op-node
cl_image: {{ localDockerImage "op-node" }}
cl_log_level: ""
cl_extra_env_vars: {}
cl_extra_labels: {}
cl_extra_params:
- "--sequencer.use-finalized=true"
cl_tolerations: []
cl_volume_size: 0
cl_min_cpu: 0
cl_max_cpu: 0
cl_min_mem: 0
cl_max_mem: 0
node_selectors: {}
tolerations: []
count: 1
network_params:
network: "kurtosis"
network_id: "2151908" # not "42220"? # Celo mainnet network ID
seconds_per_slot: 2
name: "op-kurtosis"
fjord_time_offset: 0
granite_time_offset: 0
holocene_time_offset: 0
fund_dev_accounts: true
batcher_params:
image: {{ localDockerImage "op-batcher" }}
extra_params: []
challenger_params:
image: {{ localDockerImage "op-challenger" }}
cannon_prestate_path: ""
cannon_prestates_url: "http://fileserver/proofs/op-program/cannon"
extra_params: []
proposer_params:
image: {{ localDockerImage "op-proposer" }}
extra_params: []
game_type: 1
proposal_interval: 10m
mev_params:
rollup_boost_image: ""
builder_host: ""
builder_port: ""
additional_services: []
op_contract_deployer_params:
image: {{ localDockerImage "op-deployer" }}
l1_artifacts_locator: {{ localContractArtifacts "l1" }}
l2_artifacts_locator: {{ localContractArtifacts "l2" }}
global_deploy_overrides:
faultGameAbsolutePrestate: {{ localPrestate.Hashes.prestate }}
global_log_level: "info"
global_node_selectors: {}
global_tolerations: []
persistent: false
ethereum_package:
participants:
- el_type: geth
cl_type: teku
network_params:
preset: minimal
genesis_delay: 5
additional_preloaded_contracts: |
{
"0x4e59b44847b379578588920cA78FbF26c0B4956C": {
"balance": "0ETH",
"code": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3",
"storage": {},
"nonce": "1"
}
}
25 changes: 25 additions & 0 deletions kurtosis-devnet/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ pectra-devnet: (devnet "pectra.yaml")
# Isthmus devnet
isthmus-devnet: (devnet "isthmus.yaml")

# Celo Claude devnet
celo-devnet: (devnet "celo.yaml")

# subshells
enter-devnet DEVNET CHAIN='Ethereum' NODE_INDEX='0':
exec go run ../devnet-sdk/shell/cmd/enter/main.go --devnet kt://{{DEVNET}} --chain {{CHAIN}} --node-index {{NODE_INDEX}}
Expand Down Expand Up @@ -127,6 +130,28 @@ external-batcher:
echo "$command"
$command

external-batcher-celo:
#!/usr/bin/env sh
function external_url () {
kurtosis service inspect celo-devnet "${1}" | yq .Ports."${2}" | sed -E 's#.*->\s+(.*\/)?#http://#'
}
batcher="$(pwd)/../op-batcher/bin/op-batcher"
command="${batcher} "\
"--l2-eth-rpc=$(external_url 'op-el-1-op-geth-op-node-op-kurtosis' 'rpc') "\
"--rollup-rpc=$(external_url 'op-cl-1-op-node-op-geth-op-kurtosis' 'http') "\
"--l1-eth-rpc=$(external_url 'el-1-geth-teku' 'rpc') "\
"--espresso-url=http://localhost:24000,http://localhost:24000 "\
"--espresso-light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797 "\
"--testing-espresso-batcher-private-key=0xb3d2d558e3491a3709b7c451100a0366b5872520c7aa020c17a0e7fa35b6a8df "\
"--poll-interval=1s --sub-safety-margin=6 --num-confirmations=1 --safe-abort-nonce-too-low-count=3 "\
"--resubmission-timeout=30s --rpc.addr=0.0.0.0 --rpc.port=8548 --rpc.enable-admin "\
"--max-channel-duration=1 --private-key=0xb3d2d558e3491a3709b7c451100a0366b5872520c7aa020c17a0e7fa35b6a8df "\
"--data-availability-type=calldata --metrics.enabled --metrics.addr=0.0.0.0 --metrics.port=9001 "\
"--log.level=debug"
echo "Running batcher:"
echo "$command"
$command

# Start an external batcher (assuming espresso-eb-devnet is running)
external-batcher-parameters:
#!/usr/bin/env sh
Expand Down
7 changes: 2 additions & 5 deletions op-batcher/batcher/espresso.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ func (l *BatchSubmitter) queueBlockToEspresso(ctx context.Context, block *types.
l.Log.Warn("Failed to create Espresso transaction from a batch", "err", err)
return fmt.Errorf("failed to create Espresso transaction from a batch: %w", err)
}

l.espressoSubmitter.SubmitTransaction(transaction)

return nil
Expand Down Expand Up @@ -753,7 +752,6 @@ func (l *BatchSubmitter) espressoBatchLoadingLoop(ctx context.Context, wg *sync.
}

l.espressoSyncAndRefresh(ctx, newSyncStatus)

err = l.espressoStreamer.Update(ctx)
remainingListLen := len(l.espressoStreamer.RemainingBatches)
if remainingListLen > 0 {
Expand Down Expand Up @@ -843,17 +841,16 @@ func (l *BlockLoader) EnqueueBlocks(ctx context.Context, blocksToQueue inclusive
l.reset(ctx)
break
}

blockRef, err := derive.L2BlockToBlockRef(l.batcher.RollupConfig, block)
if err != nil {
l.batcher.Log.Warn("Failed to convert block to block ref", "err", err)
continue
}

err = l.batcher.queueBlockToEspresso(ctx, block)
if err != nil {
l.batcher.Log.Warn("Failed to queue block to Espresso", "err", err)
continue
}

l.queuedBlocks = append(l.queuedBlocks, blockRef)
}
}
Expand Down