Skip to content

add initiator#90

Open
QGarchery wants to merge 5 commits into
mainfrom
initiator
Open

add initiator#90
QGarchery wants to merge 5 commits into
mainfrom
initiator

Conversation

@QGarchery

Copy link
Copy Markdown
Collaborator

No description provided.

@QGarchery
QGarchery requested review from MathisGD and bhargavbh July 24, 2026 17:26
@QGarchery QGarchery self-assigned this Jul 24, 2026
@QGarchery QGarchery linked an issue Jul 24, 2026 that may be closed by this pull request
Comment thread src/vault-exit/VaultExitBundlesV1.sol Outdated
Comment on lines +62 to +63
require(initiator == address(0), AlreadyInitiated());
initiator = msg.sender;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not resetting at the end of the function, because reading of the initiator variable should only happen if the msg.sender is the bundler. So we have the property "when initiator will be read, it will just have been set to the caller"

Although it prevents from calling this bundler functions multiple times in the same transaction. Note sure we need that, but it's cheap to add

Comment thread src/vault-exit/VaultExitBundlesV1.sol Outdated
SharesPermit memory sharesPermit,
uint256 deadline
) external {
require(initiator == address(0), AlreadyInitiated());

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This require makes it very easy to think about the initiator: you know it will stay the same for at least as long as the function call. It prevents issues such as:

  • call a function, which set the initiator
  • at the beginning of the function control flow is passed to an arbitrary address (think Midnight callback, that you normally don't need to inspect), which calls back the bundler and overwrites the initiator variable
  • then it does an interaction with a vault v2, which will read the wrong initiator value

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0fc4814df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/vault/VaultBundlesV1.sol Outdated
Comment thread src/vault/VaultBundlesV1.sol Outdated
Comment thread src/vault-exit/VaultExitBundlesV1.sol Outdated
Comment thread src/vault/VaultBundlesV1.sol Outdated
Comment on lines +67 to +68
require(initiator == address(0), AlreadyInitiated());
initiator = msg.sender;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry for the back and forth: actually I prefer when stuff that applies to all bundles is at the top. Can't we write it in one line in a way? Not worth an internal function anyway

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.

expose the initiator in vault bundles

2 participants