From 08a5b0d132bd16646dc8c10ee575ed0978f45a4c Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Tue, 25 Jul 2023 02:46:38 -0700 Subject: [PATCH] feat(node): set locals in node (#92) * set locals in node * feat: update scripts * feat: update scripts * feat: update scripts --------- Co-authored-by: David --- .env.sample | 9 ++++++--- .env.sample.l3 | 9 ++++++--- docker-compose.l3.yml | 3 +-- docker-compose.yml | 3 +-- script/l2/start-proposer.sh | 30 +++++++++++++++++++++--------- script/l3/start-proposer.sh | 30 +++++++++++++++++++++--------- 6 files changed, 56 insertions(+), 28 deletions(-) diff --git a/.env.sample b/.env.sample index 92ff3fe..b5e2a06 100644 --- a/.env.sample +++ b/.env.sample @@ -39,6 +39,9 @@ L1_PROVER_PRIVATE_KEY= # contract (be a "mining L2 node"), you need to change `ENABLE_PROPOSER` to true, then fill `L1_PROPOSER_PRIVATE_KEY` # and `L2_SUGGESTED_FEE_RECIPIENT` ENABLE_PROPOSER=false -L1_PROPOSER_PRIVATE_KEY= # A L1 account (with balance) private key who will send TaikoL1.proposeBlock transactions -L2_SUGGESTED_FEE_RECIPIENT= # A L2 account address who will be the tx fee beneficiary of the L2 blocks that you proposed -TXPOOL_LOCALS_ONLY=false # Only propose local transactions, useful to set your proposer to only propose blocks with your prover's transactions +# A L1 account (with balance) private key who will send TaikoL1.proposeBlock transactions +L1_PROPOSER_PRIVATE_KEY= +# A L2 account address who will be the tx fee beneficiary of the L2 blocks that you proposed +L2_SUGGESTED_FEE_RECIPIENT= +# comma-delinated local tx pool addresses you want to prioritize, useful to set your proposer to only propose blocks with your prover's transactions +TXPOOL_LOCALS= diff --git a/.env.sample.l3 b/.env.sample.l3 index 36ca482..4d4b5bc 100644 --- a/.env.sample.l3 +++ b/.env.sample.l3 @@ -41,6 +41,9 @@ L2_PROVER_PRIVATE_KEY= # contract (be a "mining L3 node"), you need to change `ENABLE_PROPOSER` to true, then fill `L2_PROPOSER_PRIVATE_KEY` # and `L3_SUGGESTED_FEE_RECIPIENT` ENABLE_PROPOSER=false -L2_PROPOSER_PRIVATE_KEY= # A L2 account (with balance) private key who will send TaikoL1.proposeBlock L2 transactions -L3_SUGGESTED_FEE_RECIPIENT= # A L3 account address who will be the tx fee beneficiary of the L2 blocks that you proposed -TXPOOL_LOCALS_ONLY=false # Only propose local transactions, useful to set your proposer to only propose blocks with your prover's transactions \ No newline at end of file +# A L2 account (with balance) private key who will send TaikoL1.proposeBlock L2 transactions +L2_PROPOSER_PRIVATE_KEY= +# A L3 account address who will be the tx fee beneficiary of the L2 blocks that you proposed +L3_SUGGESTED_FEE_RECIPIENT= +# comma-delinated local tx pool addresses you want to prioritize, useful to set your proposer to only propose blocks with your prover's transactions +TXPOOL_LOCALS= diff --git a/docker-compose.l3.yml b/docker-compose.l3.yml index a150844..0b85cf5 100644 --- a/docker-compose.l3.yml +++ b/docker-compose.l3.yml @@ -1,6 +1,5 @@ version: "3.4" -x-logging: - &logging +x-logging: &logging logging: options: max-size: 10m diff --git a/docker-compose.yml b/docker-compose.yml index fa91b31..b8e90f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,5 @@ version: "3.4" -x-logging: - &logging +x-logging: &logging logging: options: max-size: 10m diff --git a/script/l2/start-proposer.sh b/script/l2/start-proposer.sh index ffab1a2..4f63bf4 100755 --- a/script/l2/start-proposer.sh +++ b/script/l2/start-proposer.sh @@ -3,15 +3,27 @@ set -eou pipefail if [ "$ENABLE_PROPOSER" == "true" ]; then - taiko-client proposer \ - --l1.ws ${L1_ENDPOINT_WS} \ - --l2.http http://l2_execution_engine:8545 \ - --taikoL1 ${TAIKO_L1_ADDRESS} \ - --taikoL2 ${TAIKO_L2_ADDRESS} \ - --l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \ - --l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \ - --txpool.localsOnly ${TXPOOL_LOCALS_ONLY} \ - --minimalBlockGasLimit "5000000" + if [ -z "${TXPOOL_LOCALS}" ]; then + taiko-client proposer \ + --l1.ws ${L1_ENDPOINT_WS} \ + --l2.http http://l2_execution_engine:8545 \ + --taikoL1 ${TAIKO_L1_ADDRESS} \ + --taikoL2 ${TAIKO_L2_ADDRESS} \ + --l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \ + --l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \ + --minimalBlockGasLimit "5000000" + else + taiko-client proposer \ + --l1.ws ${L1_ENDPOINT_WS} \ + --l2.http http://l2_execution_engine:8545 \ + --taikoL1 ${TAIKO_L1_ADDRESS} \ + --taikoL2 ${TAIKO_L2_ADDRESS} \ + --l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \ + --l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \ + --txpool.locals ${TXPOOL_LOCALS} \ + --txpool.localsOnly \ + --minimalBlockGasLimit "5000000" + fi else sleep infinity fi diff --git a/script/l3/start-proposer.sh b/script/l3/start-proposer.sh index 23966e3..e8dbe3b 100755 --- a/script/l3/start-proposer.sh +++ b/script/l3/start-proposer.sh @@ -3,15 +3,27 @@ set -eou pipefail if [ "$ENABLE_PROPOSER" == "true" ]; then - taiko-client proposer \ - --l1.ws ${L2_ENDPOINT_WS} \ - --l2.http http://l3_execution_engine:8545 \ - --taikoL1 ${TAIKO_L1_ADDRESS} \ - --taikoL2 ${TAIKO_L2_ADDRESS} \ - --l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \ - --l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \ - --txpool.localsOnly ${TXPOOL_LOCALS_ONLY} \ - --minimalBlockGasLimit "5000000" + if [ -z "${TXPOOL_LOCALS}" ]; then + taiko-client proposer \ + --l1.ws ${L2_ENDPOINT_WS} \ + --l2.http http://l3_execution_engine:8545 \ + --taikoL1 ${TAIKO_L1_ADDRESS} \ + --taikoL2 ${TAIKO_L2_ADDRESS} \ + --l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \ + --l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \ + --minimalBlockGasLimit "5000000" + else + taiko-client proposer \ + --l1.ws ${L2_ENDPOINT_WS} \ + --l2.http http://l3_execution_engine:8545 \ + --taikoL1 ${TAIKO_L1_ADDRESS} \ + --taikoL2 ${TAIKO_L2_ADDRESS} \ + --l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \ + --l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \ + --txpool.locals ${TXPOOL_LOCALS} \ + --txpool.localsOnly \ + --minimalBlockGasLimit "5000000" + fi else sleep infinity fi