Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smooth-rings-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"burner-connector": patch
---

5792: Make calls sequentially to enable gas estimation for dependent calls
14 changes: 7 additions & 7 deletions packages/burner-connector/src/burnerConnector/burner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,25 @@ export const burner = ({ useSessionStorage = false, rpcUrls = {} }: BurnerConfig
}

// Execute calls sequentially for now
const requests = [];
let nonceIncrement = 0;
const hashes: `0x${string}`[] = [];
for (const call of sendCallsParams.calls) {
const request = await client.prepareTransactionRequest({
account: burnerAccount,
data: call.data as `0x${string}`,
to: call.to as `0x${string}`,
value: call.value ? hexToBigInt(call.value as `0x${string}`) : undefined,
});
requests.push({
const hash = await client.sendTransaction({
...request,
gas: (request.gas * GAS_MULTIPLIER) / 100n,
nonce: request.nonce + nonceIncrement,
});
nonceIncrement++;
hashes.push(hash);
const receipt = await publicClient.waitForTransactionReceipt({ hash });
if (receipt.status !== "success") {
break;
}
}

const hashes = await Promise.all(requests.map((request) => client.sendTransaction(request)));

// Create a robust ID by concatenating transaction hashes, chain ID, and magic identifier
const id = concat([
...hashes,
Expand Down