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!: use guessTxSizeAndSign in multicall #1053

Merged
merged 5 commits into from
Sep 20, 2024
Merged

Conversation

shamsartem
Copy link
Collaborator

No description provided.

@shamsartem shamsartem marked this pull request as draft September 20, 2024 10:30
@shamsartem shamsartem marked this pull request as ready for review September 20, 2024 11:16
@shamsartem shamsartem changed the title feat: use guessTxSizeAndSign in multicall feat!: use guessTxSizeAndSign in multicall Sep 20, 2024
return unitIds;
}).length;

const { registeredValues: addedCPs } = await guessTxSizeAndSign({
Copy link
Member

Choose a reason for hiding this comment

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

can addedCPs ever be empty due to some error handling inside guessTxSizeAndSign?

I'm vary of this while becoming an infinite loop. Maybe it makes sense to exit with error if addedCPs is empty?

Copy link
Collaborator Author

@shamsartem shamsartem Sep 20, 2024

Choose a reason for hiding this comment

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

addedCPs can't be empty cause the only way it can is if sliceIndex is 0 but there is a check in guessTxSizeAndSign that if it's 0 then fail. Basically the idea is that tx can fail for two main reasons: something is wrong with the tx or it's too big. If it's too big - we will make it smaller until it's just 0 - then we actually fail cause we can be certain that the size of the tx is not an issue - something else is

@shamsartem shamsartem merged commit 54ba2ea into main Sep 20, 2024
12 checks passed
@shamsartem shamsartem deleted the improve-multicall branch September 20, 2024 13:13
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.

3 participants