Skip to content

Conversation

@shamsartem
Copy link
Contributor

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
Contributor

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
Contributor 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
@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.

4 participants