fix(safe): preserve pending transaction gas fields - #2351
Conversation
About the
|
joelorzet
left a comment
There was a problem hiding this comment.
Scope is exact. Issue #2278 names five fields and this adds those five, nothing more.
I checked the part that could have gone wrong. SafeMultisigTransaction already declared all five with the same types the projection uses, so the values were fetched and thrown away. No new request, no change to existing fields, no change to filtering. The catalog string and docs/plugins/safe.md now match the code's field order, and you fixed two stale omissions in that string while you were in it.
One change, left inline.
Smaller point on the test: it is a single happy path with toMatchObject over a fully populated fixture. Given what these fields are for, pinning the benign case as well, a zero gasPrice with the zero address for gasToken and refundReceiver, would record what a safe transaction looks like next to what a hostile one looks like.
| **Outputs:** `success`, `transactions` (array), `count`, `error` | ||
|
|
||
| Each transaction includes: `safeTxHash`, `to`, `value`, `data`, `operation` (0=CALL, 1=DELEGATECALL), `operationLabel`, `nonce`, `confirmations`, `confirmationsRequired`, `confirmationsCollected`, `dataDecoded`, `submissionDate`, `safe` | ||
| Each transaction includes: `safeTxHash`, `to`, `value`, `data`, `operation` (0=CALL, 1=DELEGATECALL), `operationLabel`, `nonce`, `confirmations`, `confirmationsRequired`, `confirmationsCollected`, `dataDecoded`, `safeTxGas`, `baseGas`, `gasPrice`, `gasToken`, `refundReceiver`, `submissionDate`, `safe` |
There was a problem hiding this comment.
The fields are here, but nothing tells a reader why they matter.
Issue #2278 is not a completeness report. Its case is that execTransaction pays a refund from the Safe to refundReceiver and calls gasToken, so a hostile pair drains whoever executes, and that zeroed values look exactly like a benign transaction. A consumer that cannot see those two fields cannot refuse them.
After this change they can see them, and the docs give them no reason to look. The five names sit in a comma-separated run beside nonce and submissionDate, and the "When to use" line two lines down still names only DELEGATECALL, proxy upgrades and unknown targets.
Please add a sentence. Something like: a non-zero gasPrice together with a gasToken and refundReceiver makes the Safe pay a refund and call the token contract, so check all three before signing.
Fixes #2278.
Summary
safeTxGas,baseGas,gasPrice,gasToken, andrefundReceiverwhen projecting pending Safe transactionsTransaction Service test
The upstream response already contains these values; this change adds no
request and does not alter existing fields or filtering behavior.
Verification
corepack pnpm@9 exec vitest run tests/unit/safe-pending-transactions-projection.test.ts tests/unit/protocol-safe.test.ts tests/unit/validate-workflow-structural.test.ts tests/unit/credential-map-coverage.test.ts— 66 tests passedcorepack pnpm@9 run discover-pluginscorepack pnpm@9 run type-checkcorepack pnpm@9 exec biome check plugins/safe/steps/get-pending-transactions.ts plugins/safe/index.ts docs/plugins/safe.md tests/unit/safe-pending-transactions-projection.test.tsgit diff --checkAI assistance was used to prepare this contribution. I reviewed the resulting
changes and ran the checks above in a clean, lockfile-pinned checkout.