-
Notifications
You must be signed in to change notification settings - Fork 79
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
EVM: Move CALLACTOR
into a precompile
#861
Conversation
let address_offset = read_u64(input_params.next().unwrap())? as usize; | ||
let send_data_offset = read_u64(input_params.next().unwrap())? as usize; | ||
|
||
let address_size = read_u64(input_params.next().unwrap())? as usize; | ||
let send_data_size = read_u64(input_params.next().unwrap())? as usize; |
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.
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.
Ok, well after talking we are going to go with just specifying the lengths for now, if solidity is having a particularly hard time decoding these then we can add them defined exactly with solidity a ABI, but this could also be implemented easily enough in solidity itself with an SDK
add a chunked parameter reader
…ad u32 for dynamicly sized bytes
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.
Feel free to ignore the nits and do that later. But we should make the changes in the actual callactor precompile.
} | ||
|
||
pub fn exhausted(&self) -> bool { | ||
self.exhausted |
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 field seems redundant.
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.
function or field?
// will be nicer with https://github.com/rust-lang/rust/issues/74985 | ||
/// Wrapper around `ChunksExact` that pads instead of overflowing. | ||
/// Also provides a nice API interface for reading Parameters from input | ||
struct PaddedChunks<'a, T: Sized + Copy, const CHUNK_SIZE: usize> { |
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 is really nice.
let mut input_params = U256Reader::new(input); | ||
|
||
let len = input_params.next_param_padded::<u32>()? as usize; | ||
let addr = match Address::from_bytes(&read_right_pad(input_params.remaining_slice(), len)) { |
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.
It looks like reading then padding is common. We might want to provide a method.
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.
later if we need it, this PR already has a lot of changes
} | ||
} | ||
|
||
struct Parameter<T>(pub T); |
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.
A trait would fit better here.
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.
ideally yeah, but it helps a lot to avoid conflicting implementations
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.
Ah, I'm just recommending defining your own trait rather than combining a newtype with an existing trait. But we can handle that later.
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.
ah yeah that would work
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #861 +/- ##
==========================================
- Coverage 87.32% 87.09% -0.24%
==========================================
Files 125 125
Lines 22784 22953 +169
==========================================
+ Hits 19897 19991 +94
- Misses 2887 2962 +75
|
note: the TODO for static call should be fixed after filecoin-project/ref-fvm#1150 merges |
@mriise @Stebalien filecoin-project/ref-fvm#1150 has been merged. Should we continue with the TODO that you mentioned above? |
related: filecoin-project/ref-fvm#1018
closes filecoin-project/ref-fvm#1066