From 083318a2bdc9c3deb028647af1c46f3db7acacb7 Mon Sep 17 00:00:00 2001 From: Tanya S <120410716+stubbsta@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:39:19 +0200 Subject: [PATCH] replace hardcoded MAX_MESSAGE_LIMIT in RLN contract (#74) --- deploy_rln_contract.sh | 9 ++++++--- docker-compose.yml | 1 + wakusim.env | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy_rln_contract.sh b/deploy_rln_contract.sh index c741b4a..c571fa9 100644 --- a/deploy_rln_contract.sh +++ b/deploy_rln_contract.sh @@ -15,7 +15,10 @@ fi cd /waku-rlnv2-contract -# 3. Compile +#3. Replace the hardcoded MAX_MESSAGE_LIMIT +sed -i "s/\b20\b/${MAX_MESSAGE_LIMIT}/g" script/Deploy.s.sol + +# 4. Compile echo "forge install..." forge install echo "pnpm install..." @@ -23,7 +26,7 @@ pnpm install echo "forge build..." forge build -# 4. Export environment variables +# 5. Export environment variables export RCL_URL=$RCL_URL export PRIVATE_KEY=$PRIVATE_KEY export ETH_FROM=$ETH_FROM @@ -31,5 +34,5 @@ export ETH_FROM=$ETH_FROM export API_KEY_ETHERSCAN=123 export API_KEY_CARDONA=123 -# 5. Deploy the contract +# 6. Deploy the contract forge script script/Deploy.s.sol:Deploy --rpc-url $RPC_URL --broadcast -vv --private-key $PRIVATE_KEY --sender $ETH_FROM \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 08263de..075dffa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,7 @@ services: - PRIVATE_KEY=${PRIVATE_KEY} - RPC_URL=${RPC_URL:-http://foundry:8545} - ETH_FROM=${ETH_FROM} + - MAX_MESSAGE_LIMIT=${MAX_MESSAGE_LIMIT:-20} entrypoint: sh command: - '/opt/deploy_rln_contract.sh' diff --git a/wakusim.env b/wakusim.env index e2eee6f..77bf5ba 100644 --- a/wakusim.env +++ b/wakusim.env @@ -13,6 +13,7 @@ RPC_URL=http://foundry:8545 # Contract-deployment PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 +MAX_MESSAGE_LIMIT=30 # RLNv2 limits RLN_RELAY_MSG_LIMIT=10 RLN_RELAY_EPOCH_SEC=60 \ No newline at end of file