-
Notifications
You must be signed in to change notification settings - Fork 187
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
ABI refactor and removal of bytes #472
ABI refactor and removal of bytes #472
Conversation
43907c4
to
0403161
Compare
Codecov Report
@@ Coverage Diff @@
## master #472 +/- ##
=======================================
Coverage 87.31% 87.32%
=======================================
Files 76 77 +1
Lines 5046 5081 +35
=======================================
+ Hits 4406 4437 +31
- Misses 640 644 +4
Continue to review full report at Codecov.
|
Here's a sample of the new yulc panic formatting:
|
381e37f
to
ce1db94
Compare
@@ -0,0 +1,9 @@ | |||
--- |
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.
the snapshots are worth looking at
ce1db94
to
6e4eefc
Compare
vec![function.return_type], | ||
let decoding_operation = abi_operations::decode_data( | ||
&[function.return_type], | ||
identifier_expression! { outstart }, | ||
identifier_expression! { outstart }, |
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.
this should be outstart + outsize
. it's not an issue rn since the data_end
parameter is ignored, so Im just going to fix it in #440
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.
I just glanced over it but seems fine to me :)
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.
👍
AbiType::Bool => "bool".to_string(), | ||
AbiType::Address => "address".to_string(), | ||
AbiType::StaticArray { size, inner } => format!("array_{}_{}", size, typ(inner)), | ||
AbiType::Tuple { components } => format!("tuple_{}", types(components)), |
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.
This will presumably allow for naming collisions when we support nested tuples and structs. Doesn't necessarily have to be addressed now, but we need standard method for collision-avoidance everywhere code is generated (as we discussed yesterday). In the lowering pass, I added a trailing underscore to the tuple name, but maybe we should just add an incrementing number to every generated identifier (eg add a $N
suffix, which I think @Y-Nak suggested), rather than trying to differentiate between different nestings by adding a character that stands in for the parentheses.
eg
(A, (B, C), D)
-> abi_decode_component_tuple_A_tuple_B_C_D$0
(A, (B, C, D))
-> abi_decode_component_tuple_A_tuple_B_C_D$1
6e4eefc
to
9af614a
Compare
What was wrong?
The original ABI encoding/decoding implementation made it difficult to do two things:
How was it fixed?
These checks have not been added yet, but this makes it easier to add them.
Also not implemented, but I think it should be somewhat easier now.
Some other changes:
u8[n]
is now encoded as a dynamically sized bytes array.msg.sig
tou256
To-Do
OPTIONAL: Update Spec if applicable
Add entry to the release notes (may forgo for trivial changes)
Clean up commit history