Skip to content

Skip counting delegatecalls in expectCall tracker#491

Closed
filip-parity wants to merge 2 commits intomasterfrom
filip/skip-delegatecall-tracking
Closed

Skip counting delegatecalls in expectCall tracker#491
filip-parity wants to merge 2 commits intomasterfrom
filip/skip-delegatecall-tracking

Conversation

@filip-parity
Copy link
Copy Markdown

The pallet-revive tracing API only provides target addresses, not execution context, so delegatecalls appear as separate calls to different addresses. This caused expectCall(addr, data, 1) to fail when called through proxies because it saw 2 calls instead of 1:
- Call to proxy address
- Delegatecall to implementation address

Skip counting delegatecalls entirely in the call tracer, treating them as internal proxy implementation details.

input: &[u8],
_gas: Weight,
) {
if is_delegate_call {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you run ExpectCallRevive tests?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking now with the updated polkadot-sdk

@pkhry
Copy link
Copy Markdown

pkhry commented Jan 15, 2026

The pallet-revive tracing API only provides target addresses, not execution context, so delegatecalls appear as separate calls to different addresses. This caused expectCall(addr, data, 1) to fail when called through proxies because it saw 2 calls instead of 1:

  • Call to proxy address
  • Delegatecall to implementation address

Skip counting delegatecalls entirely in the call tracer, treating them as internal proxy implementation details.

can you provide a repro for this?
just to check whether this works with the changes to how delegate_call is handled in new polkadot-sdk version

@filip-parity
Copy link
Copy Markdown
Author

The root issue (pallet-revive tracing providing insufficient context) has been fixed in #467 by making is_delegate_call carry the actual target address. The current implementation correctly uses this address for call matching.

@filip-parity filip-parity deleted the filip/skip-delegatecall-tracking branch January 20, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants