Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PerOpInflator #3

Merged
merged 12 commits into from
Dec 29, 2023
Merged

feat: PerOpInflator #3

merged 12 commits into from
Dec 29, 2023

Conversation

dcposch
Copy link
Member

@dcposch dcposch commented Dec 18, 2023

This is a second bundle IInflator. The first one was a proof-of-concept for Daimo transfers.

This one takes a list of userops, each compressed with their own individual IOpInflator, concatenated. It doesn't apply any additional cross-op compression--it simply expands list[(op inflator id, compressed op)] to list[op].

Fixes #2

@dcposch
Copy link
Member Author

dcposch commented Dec 26, 2023

Down to 119 byte transfers

See https://github.com/daimo-eth/bulk/pull/3/files#diff-7b93e8b1d879dc608a53c881f55c24448923314c28c8af20d78dca2453be58fcR41-R55

  • Eliminate WebAuthn challenge entirely. Reconstruct it via the (computed) userOpHash.
  • Replace from, to with DaimoNameRegistry lookups. In future, this could be further optimized to a 4-byte index, but given that Daimo names are on average 5-6 bytes the savings are small.
  • Remove sponsoring paymaster signature. We need to use the tx.origin trick instead--otherwise, sponsoring paymaster ends up nearly doubling the size of the transfer. ERC20 paymaster unaffected.

@dcposch
Copy link
Member Author

dcposch commented Dec 28, 2023

pairs with daimo-eth/daimo#583

}

/// Inflates an op containing a Daimo ERC20 transfer.
/// This reduces calldata usage from ~1.5kb to ~400 bytes.
Copy link
Member

Choose a reason for hiding this comment

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

should this be lower now?

Copy link
Member

@nalinbhardwaj nalinbhardwaj left a comment

Choose a reason for hiding this comment

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

lgtm, looks like CI might need some updates, stubbed #5

@dcposch dcposch merged commit 9c88bd1 into master Dec 29, 2023
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.

Implement submitBatch in the BundleBulker
2 participants