Skip to content

Commit

Permalink
feat: update local stack docker compose and workflow for transaction …
Browse files Browse the repository at this point in the history
…exclusion
  • Loading branch information
jonesho committed Oct 16, 2024
1 parent 6f73b6e commit dd5abda
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/reuse-run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ jobs:
docker logs postman --since 1h &>> docker_logs/postman.txt
docker logs traces-node --since 1h &>> docker_logs/traces-node.txt
docker logs traces-node-v2 --since 1h &>> docker_logs/traces-node-v2.txt;
docker logs l2-node-besu --since 1h &>> docker_logs/l2-node-besu.txt;
docker logs transaction-exclusion-api --since 1h &>> docker_logs/transaction-exclusion-api.txt
docker logs sequencer --since 1h &>> docker_logs/sequencer.txt
- name: Archive debug logs
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:

jobs:
build-and-publish:
runs-on: ubuntu-24.04
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Transaction exclusion api build
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
Expand Down Expand Up @@ -57,7 +57,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/transaction-exclusion-api-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
run-tests:
runs-on: ubuntu-24.04
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Transaction exclusion api tests
steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ timeout = "PT20S"
[api]
port=8080
path="/"
#number-of-verticles=0 commented as default(or 0) will create one verticle per core (or hyperthread if supported)
number-of-verticles=1 #if 0 will create one verticle per core (or hyperthread if supported)
observability-port=8090
10 changes: 8 additions & 2 deletions docker/compose-local-dev-traces-v2.overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ services:
JAVA_OPTS: -XX:+UnlockExperimentalVMOptions -XX:-UseG1GC -XX:+UseZGC
volumes:
- ../config/common/traces-limits-besu-v2.toml:/var/lib/besu/traces-limits.toml:ro

l2-node-besu:
environment:
JAVA_OPTS: -XX:+UnlockExperimentalVMOptions -XX:-UseG1GC -XX:+UseZGC
volumes:
- ../config/common/traces-limits-besu-v2.toml:/var/lib/besu/traces-limits.toml:ro

linea-besu-sequencer-plugin-downloader:
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.8.0-rc1.1/linea-sequencer-v0.8.0-rc1.1.jar", "/linea-besu-sequencer" ]
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.8.0-rc4.1/linea-sequencer-v0.8.0-rc4.1.jar", "/linea-besu-sequencer" ]

traces-node:
command: ['echo', 'forced exit as replaced by traces-node-v2']
Expand Down Expand Up @@ -40,6 +46,7 @@ services:
retries: 120
restart: "no"
environment:
JAVA_OPTS: -XX:+UnlockExperimentalVMOptions -XX:-UseG1GC -XX:+UseZGC
LOG4J_CONFIGURATION_FILE: /var/lib/besu/log4j.xml
entrypoint:
- /bin/bash
Expand All @@ -51,7 +58,6 @@ services:
--bootnodes=enode://14408801a444dafc44afbccce2eb755f902aed3b5743fed787b3c790e021fef28b8c827ed896aa4e8fb46e22bd67c39f994a73768b4b382f8597b0d44370e15d@11.11.11.101:30303
volumes:
- ./config/traces-node-v2/traces-node-v2-config.toml:/var/lib/besu/traces-node-v2.config.toml:ro
- ./config/traces-node-v2/key:/var/lib/besu/key:ro
- ./config/traces-node-v2/log4j.xml:/var/lib/besu/log4j.xml:ro
- ./config/linea-local-dev-genesis-PoA-besu.json/:/var/lib/besu/genesis.json:ro
- ../tmp/traces-node-v2/plugins:/opt/besu/plugins/
Expand Down
4 changes: 4 additions & 0 deletions docker/compose-local-dev.overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ services:
l1-el-node:
environment:
JAVA_OPTS: -XX:+UnlockExperimentalVMOptions -XX:-UseG1GC -XX:+UseZGC

l2-node-besu:
environment:
JAVA_OPTS: -XX:+UnlockExperimentalVMOptions -XX:-UseG1GC -XX:+UseZGC
57 changes: 53 additions & 4 deletions docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ services:
--node-private-key-file="/var/lib/besu/key" \
--plugin-linea-l1-polling-interval="PT12S" \
--plugin-linea-l1-smart-contract-address="0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9" \
--plugin-linea-l1-rpc-endpoint="http://l1-el-node:8545"
--plugin-linea-l1-rpc-endpoint="http://l1-el-node:8545" \
--plugin-linea-rejected-tx-endpoint="http://transaction-exclusion-api:8080" \
--plugin-linea-node-type="SEQUENCER"
volumes:
- ./config/linea-besu-sequencer/sequencer.config.toml:/var/lib/besu/sequencer.config.toml:ro
- ./config/linea-besu-sequencer/deny-list.txt:/var/lib/besu/deny-list.txt:ro
Expand All @@ -71,7 +73,7 @@ services:
linea-besu-sequencer-plugin-downloader:
image: busybox:1.36.1
# profiles: ["l2", "l2-bc"] this works locally but breakes on CI, maybe Docker compose version issue
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.1.4-test34/besu-sequencer-plugins-v0.1.4-test34.jar", "/linea-besu-sequencer" ]
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.1.4-test35/besu-sequencer-plugins-v0.1.4-test35.jar", "/linea-besu-sequencer" ]
volumes:
- ./scripts/file-downloader.sh:/file-downloader.sh:ro
- ../tmp/linea-besu-sequencer/plugins:/linea-besu-sequencer/
Expand Down Expand Up @@ -116,6 +118,54 @@ services:
networks:
linea:
ipv4_address: 11.11.11.209

l2-node-besu:
hostname: l2-node-besu
container_name: l2-node-besu
image: consensys/linea-besu:24.10-delivery34
profiles: [ "l2", "l2-bc", "debug" ]
depends_on:
sequencer:
condition: service_healthy
ports:
- "9045:8545"
- "9046:8546"
- "9050:8550"
- "9051:8548"
- "30309:30303"
healthcheck:
test: [ "CMD-SHELL", "bash -c \"[ -f /tmp/pid ]\"" ]
interval: 1s
timeout: 1s
retries: 120
restart: "no"
environment:
LOG4J_CONFIGURATION_FILE: /var/lib/besu/log4j.xml
entrypoint:
- /bin/bash
- -c
- |
/opt/besu/bin/besu \
--config-file=/var/lib/besu/l2-node-besu.config.toml \
--genesis-file=/var/lib/besu/genesis.json \
--plugin-linea-l1-polling-interval="PT12S" \
--plugin-linea-l1-smart-contract-address="0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9" \
--plugin-linea-l1-rpc-endpoint="http://l1-el-node:8545" \
--plugin-linea-rejected-tx-endpoint="http://transaction-exclusion-api:8080" \
--plugin-linea-node-type="P2P" \
--bootnodes=enode://14408801a444dafc44afbccce2eb755f902aed3b5743fed787b3c790e021fef28b8c827ed896aa4e8fb46e22bd67c39f994a73768b4b382f8597b0d44370e15d@11.11.11.101:30303
volumes:
- ./config/l2-node-besu/l2-node-besu-config.toml:/var/lib/besu/l2-node-besu.config.toml:ro
- ./config/linea-besu-sequencer/deny-list.txt:/var/lib/besu/deny-list.txt:ro
- ./config/l2-node-besu/log4j.xml:/var/lib/besu/log4j.xml:ro
- ./config/linea-local-dev-genesis-PoA-besu.json/:/var/lib/besu/genesis.json:ro
- ../config/common/traces-limits-besu-v1.toml:/var/lib/besu/traces-limits.toml:ro
- ../tmp/linea-besu-sequencer/plugins:/opt/besu/plugins/
- ../tmp/local/:/data/:rw
networks:
l1-network:
linea:
ipv4_address: 11.11.11.119

traces-node:
container_name: traces-node
Expand Down Expand Up @@ -258,7 +308,7 @@ services:
transaction-exclusion-api:
hostname: transaction-exclusion-api
container_name: transaction-exclusion-api
image: consensys/linea-transaction-exclusion-api:${TRANSACTION_EXCLUSION_API_TAG:-a1e7eee}
image: consensys/linea-transaction-exclusion-api:${TRANSACTION_EXCLUSION_API_TAG:-d227ddf}
profiles: [ "l2", "debug" ]
restart: on-failure
depends_on:
Expand Down Expand Up @@ -520,7 +570,6 @@ services:
volumes:
- ./config/zkbesu-shomei/zkbesu-config.toml:/var/lib/besu/zkbesu-config.toml:ro
- ./config/zkbesu-shomei/key:/var/lib/besu/key:ro
- ./config/zkbesu-shomei/log4j.xml:/var/lib/besu/log4j.xml:ro
- ./config/linea-local-dev-genesis-PoA-besu.json/:/var/lib/besu/genesis.json:ro
- ../tmp/zkbesu-shomei/plugins:/opt/besu/plugins/
Expand Down
50 changes: 50 additions & 0 deletions docker/config/l2-node-besu/l2-node-besu-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
data-path="/opt/besu/data"
host-whitelist=["*"]
sync-mode="FULL"
p2p-port=30303

min-gas-price=0

# engine
engine-host-allowlist=["*"]
engine-rpc-port=8550

# rpc
rpc-http-enabled=true
rpc-http-host="0.0.0.0"
rpc-http-port=8545
rpc-http-cors-origins=["*"]
rpc-http-api=["ADMIN","DEBUG","NET","ETH","WEB3","PLUGINS","LINEA"]
rpc-http-max-active-connections=200

# ws
rpc-ws-enabled=true
rpc-ws-host="0.0.0.0"
rpc-ws-port=8546
rpc-ws-api=["ADMIN","TXPOOL","WEB3","ETH","NET","PERM"]
rpc-ws-max-active-connections=200

# graphql
graphql-http-enabled=false

# metrics
metrics-enabled=true
metrics-host="0.0.0.0"
metrics-port=9545

# database
data-storage-format="BONSAI"

# plugins
plugin-linea-module-limit-file-path="/var/lib/besu/traces-limits.toml"
plugin-linea-deny-list-path="/var/lib/besu/deny-list.txt"
plugin-linea-l1l2-bridge-contract="0xe537D669CA013d86EBeF1D64e40fC74CADC91987"
plugin-linea-l1l2-bridge-topic="e856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c"
plugin-linea-tx-pool-profitability-check-p2p-enabled=false
plugin-linea-tx-pool-profitability-check-api-enabled=false
plugin-linea-tx-pool-simulation-check-api-enabled=true
plugin-linea-tx-pool-simulation-check-p2p-enabled=false
plugin-linea-estimate-gas-compatibility-mode-enabled=false

Xbonsai-limit-trie-logs-enabled=false
bonsai-historical-block-limit=1024
44 changes: 44 additions & 0 deletions docker/config/l2-node-besu/log4j.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO" monitorInterval="2">
<Properties>
<Property name="root.log.level">WARN</Property>
</Properties>

<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSSZZZ} | %t | %-5level | %c{1} | %msg %throwable%n" />
</Console>
</Appenders>
<Loggers>
<!-- edit the package name/level below to add more logging to specific classes -->
<!-- no need to restart Besu as it will detect changes every 2s -->
<Logger name="org.hyperledger.besu" level="WARN" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<!-- to avoid annoying message "INFO ... No sync target, waiting for peers. Current peers: 0" change to WARN-->
<Logger name="org.hyperledger.besu.ethereum.eth.sync.fullsync.FullSyncTargetManager" level="INFO" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="org.hyperledger.besu.ethereum.blockcreation" level="INFO" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="org.hyperledger.besu.consensus.merge.blockcreation" level="INFO" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="org.hyperledger.besu.ethereum.api.jsonrpc" level="TRACE" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="io.opentelemetry" level="WARN" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="net.consensys.linea.sequencer.txselection.selectors" level="DEBUG">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="org.hyperledger.besu.ethereum.eth.transactions.TransactionPool" level="TRACE" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Root level="${sys:root.log.level}">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
2 changes: 1 addition & 1 deletion docker/config/linea-besu-sequencer/sequencer.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tx-pool-no-local-priority=false
api-gas-and-priority-fee-limiting-enabled=false
api-gas-and-priority-fee-lower-bound-coefficient=120
api-gas-and-priority-fee-upper-bound-coefficient=300
poa-block-txs-selection-max-time=1000
poa-block-txs-selection-max-time=3000

# plugins
plugin-linea-module-limit-file-path="/var/lib/besu/traces-limits.toml"
Expand Down

0 comments on commit dd5abda

Please sign in to comment.