Skip to content

Commit

Permalink
feat: use l1 mock
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Oct 23, 2024
1 parent aec6146 commit 8f017ed
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
CLUSTER_PROFILE_FLAG=$([ "${IS_MANUAL_DEPLOYMENT}" == "true" ] && echo "--profile ${{ github.event.inputs.profile }}" || echo "--profile ci")
CLUSTER_LOGS_FLAG=$([ "${{ github.event.inputs.logs }}" == "false" ] && echo "--no-logs-collection" || echo "")
CLUSTER_DATADOG_KEY_FLAG=$([ "${IS_MANUAL_DEPLOYMENT}" == "true" ] && echo "--datadog-key ${{ secrets.DATADOG_API_KEY }}" || echo "")
CLUSTER_L1_RPC_URL_FLAG="--l1-rpc-urls ${{ secrets.L1_RPC_URL }}"
CLUSTER_OTEL_COLLECTOR_ENDPOINT_URL_FLAG=$([ "${{ github.event.inputs.tracing }}" == "true" ] && echo "--otel-collector-endpoint-url grpc://${TARGET_MACHINE_IP}:4317" || echo "")
CLUSTER_DEBUG_FLAG=$([ "${{ github.event.inputs.debug }}" == "true" ] && echo "--debug" || echo "")
Expand All @@ -84,7 +83,6 @@ jobs:
echo "CLUSTER_PROFILE_FLAG=${CLUSTER_PROFILE_FLAG}" >> ${GITHUB_ENV}
echo "CLUSTER_LOGS_FLAG=${CLUSTER_LOGS_FLAG}" >> ${GITHUB_ENV}
echo "CLUSTER_DATADOG_KEY_FLAG=${CLUSTER_DATADOG_KEY_FLAG}" >> ${GITHUB_ENV}
echo "CLUSTER_L1_RPC_URL_FLAG=${CLUSTER_L1_RPC_URL_FLAG}" >> ${GITHUB_ENV}
echo "CLUSTER_OTEL_COLLECTOR_ENDPOINT_URL_FLAG=${CLUSTER_OTEL_COLLECTOR_ENDPOINT_URL_FLAG}" >> ${GITHUB_ENV}
echo "CLUSTER_DEBUG_FLAG=${CLUSTER_DEBUG_FLAG}" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -215,7 +213,6 @@ jobs:
${CLUSTER_PROFILE_FLAG} \
${CLUSTER_LOGS_FLAG} \
${CLUSTER_DATADOG_KEY_FLAG} \
${CLUSTER_L1_RPC_URL_FLAG} \
${CLUSTER_OTEL_COLLECTOR_ENDPOINT_URL_FLAG} \
${CLUSTER_DEBUG_FLAG}
END_TIME="$(date +%s)"
Expand Down
3 changes: 2 additions & 1 deletion bridge/standard/bridge-v1/cmd/emulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"os"
"os/signal"
"path"
"slices"
"strings"
"syscall"
Expand Down Expand Up @@ -160,7 +161,7 @@ func main() {
if len(parts) != 2 {
return fmt.Errorf("invalid keystore-path-password format: %s", kp)
}
keySigner, err := keysigner.NewKeystoreSigner(parts[0], parts[1])
keySigner, err := keysigner.NewKeystoreSigner(path.Dir(parts[0]), parts[1])
if err != nil {
return fmt.Errorf("failed creating key signer: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/nomad/cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ deploy_version="HEAD"
environment_name="devenv"
profile_name="devnet"
datadog_key=""
l1_rpc_urls=""
l1_rpc_urls="mock"
otel_collector_endpoint_url=""
genesis_file_url=""
geth_bootnode_url=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ job "{{ job.name }}" {
export MEV_ORACLE_PG_PASSWORD="${POSTGRES_PASSWORD}"
export MEV_ORACLE_PG_DBNAME="${POSTGRES_DB}"

if ! timeout 5m bash -c 'until pg_isready -h ${MEV_ORACLE_PG_HOST} -p ${MEV_ORACLE_PG_PORT} -U ${MEV_ORACLE_PG_USER} -d ${MEV_ORACLE_PG_DBNAME}; do sleep 1; done'; then
if ! timeout 5m bash -c 'until pg_isready -h ${MEV_ORACLE_PG_HOST} -p ${MEV_ORACLE_PG_PORT} -U ${MEV_ORACLE_PG_USER} -d ${MEV_ORACLE_PG_DBNAME}; do sleep 2; done'; then
echo "Waiting for PostgreSQL to start..."
sleep 3
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ job "{{ job.name }}" {

# Mutate genesis file to only have a single alloc to contract deployer
${GETH_BIN} --dev dumpgenesis > local/default_genesis.json
jq -s '.[0].alloc = .[1].alloc | .[0]' local/default_genesis.json local/genesis_{{ version }}.json > local/genesis.json
jq -s '
.[0].alloc = .[1].alloc
| .[0].config.chainId = .[1].config.chainId
| .[0]
' local/default_genesis.json local/genesis_{{ version }}.json > local/genesis.json
${GETH_BIN} --datadir local/data init local/genesis.json

exec ${GETH_BIN} \
Expand Down
9 changes: 5 additions & 4 deletions infrastructure/nomad/playbooks/variables/profiles.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
datacenter: "dc1"
resolved_l1_rpc_urls: "{{ ('http://' ~ ansible_facts['default_ipv4']['address'] ~ ':9545') if l1_rpc_urls == 'mock' else l1_rpc_urls }}"

artifacts:
bidder_emulator: &bidder_emulator_artifact
Expand Down Expand Up @@ -504,7 +505,7 @@ jobs:
- metrics:
to: 8080
env:
l1_rpc_url: "{{ l1_rpc_urls.split(',')[0] }}"
l1_rpc_url: "{{ resolved_l1_rpc_urls.split(',')[0] }}"
otel_collector_endpoint_url: "{{ otel_collector_endpoint_url }}"

mev_commit_bidder_emulator_nodes: &mev_commit_bidder_emulator_nodes_job
Expand All @@ -521,7 +522,7 @@ jobs:
- metrics:
to: 8080
env:
l1_rpc_url: "{{ l1_rpc_urls.split(',')[0] }}"
l1_rpc_url: "{{ resolved_l1_rpc_urls.split(',')[0] }}"

mev_commit_oracle: &mev_commit_oracle_job
name: mev-commit-oracle
Expand All @@ -546,7 +547,7 @@ jobs:
metrics:
to: 8080
env:
l1_rpc_urls: "{{ l1_rpc_urls }}"
l1_rpc_urls: "{{ resolved_l1_rpc_urls }}"

mev_commit_bridge: &mev_commit_bridge_job
name: mev-commit-bridge
Expand All @@ -559,7 +560,7 @@ jobs:
to: 8080
env:
l1_chain_id: "{{ environments[env].chain_id }}"
l1_rpc_url: "{{ l1_rpc_urls.split(',')[0] }}"
l1_rpc_url: "{{ resolved_l1_rpc_urls.split(',')[0] }}"

mev_commit_faucet: &mev_commit_faucet_job
name: mev-commit-faucet
Expand Down

0 comments on commit 8f017ed

Please sign in to comment.