-
Notifications
You must be signed in to change notification settings - Fork 39
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(types): use alloy/native types in types crate #802
Conversation
4736bfb
to
f908cc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
@@ -44,8 +43,83 @@ pub const ENTRY_POINT_INNER_GAS_OVERHEAD: U256 = U256([5_000, 0, 0, 0]); | |||
/// paymaster_and_data = 32 bytes + 32 bytes num elems + var 32 | |||
/// signature = 32 bytes + 32 bytes num elems + var 32 | |||
/// | |||
/// 15 * 32 = 480 | |||
const ABI_ENCODED_USER_OPERATION_FIXED_LEN: usize = 480; | |||
/// +1 for good luck? (aka this is what I got when I was testing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
luck is on our side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I couldn't figure this out, would love to look into it more but I trust the numbers coming out of alloy.
+ super::byte_array_abi_len(&self.packed.call_data) | ||
+ super::byte_array_abi_len(&self.packed.paymaster_and_data) | ||
+ super::byte_array_abi_len(&self.packed.initCode) | ||
+ super::byte_array_abi_len(&self.packed.callData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hate that the sol stuff defaults to camelcase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. It actually worked out somewhat okay because we wrap a lot of the onchain types in our own types where we use snake_case. So its isolated to a few files that deal with the onchain types.
Looks like their might just be an issue with the build.rs stuff |
Hm, yeah it looks like Foundry isn't running for some reason in the contracts |
let cgl = super::default_if_none_or_equal(self.call_gas_limit, max_call_gas, 0); | ||
let vgl = | ||
super::default_if_none_or_equal(self.verification_gas_limit, max_verification_gas, 0); | ||
let pvg = super::default_if_none_or_equal(self.pre_verification_gas, max_call_gas, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, I find those 3 variables only used to construct UO below, is that possible to inline them like L418 to L424?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but they're pulled out specifically so that the comment above clearly applies to these conversations
max_verification_gas, | ||
U128::zero(), | ||
); | ||
let cgl = super::default_if_none_or_equal(self.call_gas_limit, max_call_gas, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
No description provided.