You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-3Lines changed: 67 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,15 +107,79 @@ Forwarder function. Initializes with a parent and a fee address. It will forward
107
107
108
108
Factory to create updated forwarder (contracts/ForwarderV4.sol). Deploys a small proxy which utilizes the implementation of a single forwarder contract.
109
109
110
+
## Batcher gas params and admin script
111
+
112
+
Centralized defaults used when deploying a new Batcher:
Deploying Batcher (uses `config/configGasParams.ts` for constructor args):
116
+
```sh
117
+
npm run deploy-batcher -- --network <network>
118
+
```
119
+
120
+
Optional constructor override during deploy:
121
+
-`TRANSFER_GAS_LIMIT` or `BATCHER_TRANSFER_GAS_LIMIT` to set a custom initial transferGasLimit.
122
+
Notes:
123
+
- On Somnia (testnet/mainnet), the deploy script automatically enforces a high gasLimit floor and sets robust fee params; no action needed.
124
+
125
+
Updating transferGasLimit on an existing Batcher (env-only, simplified):
126
+
- Required envs:
127
+
-`BATCHER_ADDRESS` — the deployed Batcher address
128
+
-`TRANSFER_GAS_LIMIT` — the new per-recipient gas stipend (number)
129
+
- Behavior:
130
+
- Uses signers[0] for the selected Hardhat network.
131
+
- Verifies there is contract code at `BATCHER_ADDRESS` and that signers[0] is the on-chain owner; otherwise exits early.
132
+
- Gas params come from `scripts/chainConfig.ts` per chain; Somnia gets high gasLimit automatically.
133
+
```sh
134
+
BATCHER_ADDRESS=0xYourBatcher \
135
+
TRANSFER_GAS_LIMIT=300000 \
136
+
npm run update-gas-limit -- --network <network>
137
+
```
138
+
Ensure the first account in `networks.<name>.accounts` (Hardhat config) is the Batcher owner on that chain.
139
+
140
+
### Testing tools: GasHeavy end-to-end retest
141
+
142
+
Run the GasHeavy scenario tool (low limit fails, high limit succeeds):
143
+
```sh
144
+
BATCHER_ADDRESS=0xYourBatcherAddress \
145
+
npx hardhat run test/tools/retestGasHeavy.ts --network tstt
146
+
```
147
+
148
+
Important:
149
+
- The tool reads `BATCHER_ADDRESS` from the environment (Hardhat doesn’t forward unknown CLI flags).
150
+
- Optional envs:
151
+
-`OWNER_PRIVATE_KEY=0x...` to perform owner-only updates inside the tool; if omitted, owner updates are skipped and the test proceeds with current limits.
152
+
-`GAS_HEAVY=0x...` to reuse a pre-deployed GasHeavy. On Somnia (50312/5031), the tool enforces a high gasLimit floor during deployment and will retry code detection; providing `GAS_HEAVY` skips deploy variance.
153
+
-`LOW_LIMIT=2300`, `HIGH_LIMIT=300000`, `AMOUNT_WEI=100000000000000` to tweak behavior.
154
+
- Tools under `test/tools` are not part of the Mocha test run; execute them with `hardhat run` as shown.
155
+
- To change transferGasLimit for real, use the admin script in the previous section.
156
+
157
+
### GitHub Actions: update_transfer_gas_limit
158
+
159
+
Trigger a transferGasLimit update via the workflow dispatch:
160
+
161
+
1. In GitHub, run the workflow: Actions > "Update Batcher transferGasLimit" > Run workflow
162
+
- Inputs (required):
163
+
-`environment`: `testnet` or `mainnet`
164
+
-`network`: Hardhat network name (e.g., `tstt`, `stt`)
165
+
-`batcher_address`: the deployed Batcher address
166
+
-`gas_limit`: the new transferGasLimit value
167
+
168
+
Behavior:
169
+
- The workflow exports `BATCHER_ADDRESS` and `TRANSFER_GAS_LIMIT` for the script.
170
+
- The script uses the first configured signer on that network; make sure that signer is the on-chain owner or the run will fail.
0 commit comments