Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat: update blob.go
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Feb 9, 2024
1 parent f62dffb commit edf4b1a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 241 deletions.
13 changes: 9 additions & 4 deletions driver/txlist_fetcher/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ func (d *BlobFetcher) Fetch(
return nil, err
}

log.Info("Fetch sidecars", "sidecars", sidecars)
log.Info("Fetch sidecars", "slot", meta.L1Height+1, "sidecars", len(sidecars))

for _, sidecar := range sidecars {
log.Info("Found sidecar", "KzgCommitment", sidecar.KzgCommitment, "blobHash", common.Bytes2Hex(meta.BlobHash[:]))
for i, sidecar := range sidecars {
log.Info(
"Block sidecar",
"index", i,
"KzgCommitment", sidecar.KzgCommitment,
"blobHash", common.Bytes2Hex(meta.BlobHash[:]),
)

if kZGToVersionedHash(
kzg4844.Commitment(common.Hex2Bytes(sidecar.KzgCommitment)[:]),
kzg4844.Commitment(common.FromHex(sidecar.KzgCommitment)),
) == common.BytesToHash(meta.BlobHash[:]) {
return common.Hex2Bytes(sidecar.Blob), nil
}
Expand Down
29 changes: 0 additions & 29 deletions internal/docker/consensus/config.yml

This file was deleted.

141 changes: 11 additions & 130 deletions internal/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,138 +1,19 @@
version: "3.9"

services:
# Creates a genesis state for the beacon chain using a YAML configuration file and
# a deterministic set of 64 validators.
create-beacon-chain-genesis:
image: "gcr.io/prysmaticlabs/prysm/cmd/prysmctl:latest"
command:
- testnet
- generate-genesis
- --fork=deneb
- --num-validators=64
- --genesis-time-delay=15
- --output-ssz=/consensus/genesis.ssz
- --chain-config-file=/consensus/config.yml
- --geth-genesis-json-in=/execution/genesis.json
- --geth-genesis-json-out=/execution/genesis.json
volumes:
- ./consensus:/consensus
- ./execution:/execution

# Removes the database of the go-ethereum execution client to ensure we start from a clean state.
# (geth has a `removedb` option, but it asks for a keyboard confirmation, so we use this instead)
geth-remove-db:
image: "alpine:latest"
command: rm -rf /execution/geth
volumes:
- ./execution:/execution

# Sets up the genesis configuration for the go-ethereum client from a JSON file.
geth-genesis:
image: "ethereum/client-go:v1.13.11"
command: --datadir=/execution init /execution/genesis.json
volumes:
- ./execution:/execution
- ./execution/genesis.json:/execution/genesis.json
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
geth-remove-db:
condition: service_completed_successfully

# Runs a Prysm beacon chain from a specified genesis state created in the previous step
# and connects to go-ethereum in the same network as the execution client.
# The account used in go-ethereum is set as the suggested fee recipient for transactions
# proposed via the validators attached to the beacon node.
beacon-chain:
image: "gcr.io/prysmaticlabs/prysm/beacon-chain:stable"
container_name: beacon-chain
command:
- --datadir=/consensus/beacondata
# No peers to sync with in this testnet, so setting to 0
- --min-sync-peers=0
- --genesis-state=/consensus/genesis.ssz
- --bootstrap-node=
- --interop-eth1data-votes
# The chain configuration file used for setting up Prysm
- --chain-config-file=/consensus/config.yml
# We specify the chain id used by our execution client
- --contract-deployment-block=0
- --chain-id=${CHAIN_ID:-32382}
- --rpc-host=0.0.0.0
- --grpc-gateway-host=0.0.0.0
- --execution-endpoint=http://geth:8551
- --accept-terms-of-use
- --jwt-secret=/execution/jwtsecret
- --suggested-fee-recipient=0x123463a4b065722e99115d6c222f267d9cabb524
- --minimum-peers-per-subnet=0
- --enable-debug-rpc-endpoints
- --force-clear-db
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
ports:
- "3500"
volumes:
- ./consensus:/consensus
- ./execution:/execution
- ./execution/jwtsecret:/execution/jwtsecret

# Runs the go-ethereum execution client with the specified, unlocked account and necessary
# APIs to allow for proof-of-stake consensus via Prysm.
geth:
image: "ethereum/client-go:v1.13.11"
container_name: geth
command:
- --http
- --http.addr=0.0.0.0
- --http.corsdomain=*
- --http.api=admin,debug,web3,eth,txpool,personal,miner,net
- --ws
- --ws.addr=0.0.0.0
- --ws.origins=*
- --ws.api=admin,debug,web3,eth,txpool,personal,miner,net
- --authrpc.vhosts=*
- --authrpc.addr=0.0.0.0
- --authrpc.jwtsecret=/execution/jwtsecret
- --datadir=/execution
- --allow-insecure-unlock
- --unlock=0x123463a4b065722e99115d6c222f267d9cabb524
- --password=/execution/geth_password.txt
- --nodiscover
- --syncmode=full
- --gcmode=archive
l1_node:
container_name: l1_node
image: ghcr.dockerproxy.com/foundry-rs/foundry:latest
restart: unless-stopped
pull_policy: always
ports:
- "8545"
- "8546"
depends_on:
geth-genesis:
condition: service_completed_successfully
beacon-chain:
condition: service_started
volumes:
- ./execution:/execution
- ./execution/jwtsecret:/execution/jwtsecret
- ./execution/geth_password.txt:/execution/geth_password.txt

# We run a validator client with 64, deterministically-generated keys that match
# The validator keys present in the beacon chain genesis state generated a few steps above.
validator:
image: "gcr.io/prysmaticlabs/prysm/validator:stable"
container_name: validator
command:
- --beacon-rpc-provider=beacon-chain:4000
- --datadir=/consensus/validatordata
- --accept-terms-of-use
- --interop-num-validators=64
- --interop-start-index=0
- --chain-config-file=/consensus/config.yml
- --force-clear-db
depends_on:
beacon-chain:
condition: service_started
volumes:
- ./consensus:/consensus
entrypoint:
- anvil
- --host
- "0.0.0.0"
- --hardfork
- "cancun"

l2_execution_engine:
container_name: l2_node
Expand Down
Loading

0 comments on commit edf4b1a

Please sign in to comment.