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

Commit

Permalink
Merge branch 'main' into fix/config
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Jan 19, 2024
2 parents 7327658 + 430abd6 commit 2a99810
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 27 deletions.
6 changes: 6 additions & 0 deletions bindings/encoding/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ var (
Name: "metaHash",
Type: "bytes32",
},
{
Name: "parentMetaHash",
Type: "bytes32",
},
{
Name: "tierFees",
Type: "tuple[]",
Expand Down Expand Up @@ -246,6 +250,7 @@ var (
{Name: "taikoAddress", Type: addressType},
{Name: "assignmentHookAddress", Type: addressType},
{Name: "metaHash", Type: bytes32Type},
{Name: "parentMetaHash", Type: bytes32Type},
{Name: "blobHash", Type: bytes32Type},
{Name: "assignment.feeToken", Type: addressType},
{Name: "assignment.expiry", Type: uint64Type},
Expand Down Expand Up @@ -335,6 +340,7 @@ func EncodeProverAssignmentPayload(
taikoAddress,
assignmentHookAddress,
common.Hash{},
common.Hash{},
txListHash,
feeToken,
expiry,
Expand Down
15 changes: 8 additions & 7 deletions bindings/encoding/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ type TierFee struct {

// ProverAssignment should be same with TaikoData.ProverAssignment.
type ProverAssignment struct {
FeeToken common.Address
Expiry uint64
MaxBlockId uint64 // nolint: revive,stylecheck
MaxProposedIn uint64
MetaHash [32]byte
TierFees []TierFee
Signature []byte
FeeToken common.Address
Expiry uint64
MaxBlockId uint64 // nolint: revive,stylecheck
MaxProposedIn uint64
MetaHash [32]byte
ParentMetaHash [32]byte
TierFees []TierFee
Signature []byte
}

// AssignmentHookInput should be same as AssignmentHook.Input
Expand Down
34 changes: 27 additions & 7 deletions internal/docker/docker_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

export L1_NODE_HTTP_ENDPOINT=http://localhost:18545
export L1_NODE_WS_ENDPOINT=ws://localhost:18546
export L1_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:18551
# check until L1 chain is ready
L1_PROBE_URL=http://localhost:$(docker port l1_node | grep '0.0.0.0' | awk -F ':' '{print $2}')
until cast chain-id --rpc-url "$L1_PROBE_URL" 2> /dev/null; do
sleep 1
done

export L2_EXECUTION_ENGINE_HTTP_ENDPOINT=http://localhost:28545
export L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:28546
export L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:28551
# check until L2 chain is ready
L2_PROBE_URL=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==1 {print $2}')
until cast chain-id --rpc-url "$L2_PROBE_URL" 2> /dev/null; do
sleep 1
done


L1_NODE_PORT=$(docker port l1_node | grep '0.0.0.0' | awk -F ':' '{print $2}')
export L1_NODE_HTTP_ENDPOINT=http://localhost:$L1_NODE_PORT
export L1_NODE_WS_ENDPOINT=ws://localhost:$L1_NODE_PORT

export L2_EXECUTION_ENGINE_HTTP_ENDPOINT=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==1 {print $2}')
export L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
export L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==3 {print $2}')
export JWT_SECRET=$DIR/nodes/jwt.hex

export DOCKER_SERVICE_LIST=("l1_node" "l2_execution_engine")
echo -e "L1_NODE PORTS: \n$(docker port l1_node)"
echo -e "L2_NODE PORTS: \n$(docker port l2_node)"

echo "L1_NODE_HTTP_ENDPOINT: $L1_NODE_HTTP_ENDPOINT"
echo "L1_NODE_WS_ENDPOINT: $L1_NODE_WS_ENDPOINT"
echo "L2_EXECUTION_ENGINE_HTTP_ENDPOINT: $L2_EXECUTION_ENGINE_HTTP_ENDPOINT"
echo "L2_EXECUTION_ENGINE_WS_ENDPOINT: $L2_EXECUTION_ENGINE_WS_ENDPOINT"
echo "L2_EXECUTION_ENGINE_AUTH_ENDPOINT: $L2_EXECUTION_ENGINE_AUTH_ENDPOINT"
9 changes: 4 additions & 5 deletions internal/docker/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ services:
restart: unless-stopped
pull_policy: always
ports:
- "18545:8545"
- "18546:8545"
- "8545"
entrypoint:
- anvil
- --host
Expand All @@ -22,9 +21,9 @@ services:
volumes:
- .:/host
ports:
- "28545:8545"
- "28546:8546"
- "28551:8551"
- "8545"
- "8546"
- "8551"
command:
- --nodiscover
- --gcmode
Expand Down
8 changes: 2 additions & 6 deletions internal/docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#!/bin/bash

source scripts/common.sh
source internal/docker/docker_env.sh

DOCKER_SERVICE_LIST=("l1_node" "l2_execution_engine")

# start docker compose service list
echo "start docker compose service: ${DOCKER_SERVICE_LIST[*]}"

compose_up "${DOCKER_SERVICE_LIST[@]}"

# check until L1 chain is ready
until cast chain-id --rpc-url "$L2_EXECUTION_ENGINE_HTTP_ENDPOINT"; do
sleep 1
done

# show all the running containers
echo
docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}"
4 changes: 2 additions & 2 deletions internal/docker/stop.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash


source scripts/common.sh
source internal/docker/docker_env.sh

DOCKER_SERVICE_LIST=("l1_node" "l2_execution_engine")

echo "stop docker compose service: ${DOCKER_SERVICE_LIST[*]}"

Expand Down

0 comments on commit 2a99810

Please sign in to comment.