-
Notifications
You must be signed in to change notification settings - Fork 81
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
IPLD Block Abstraction #758
Labels
Comments
Stebalien
added a commit
that referenced
this issue
Oct 18, 2022
The previous code was passing parameters as raw bytes, but telling the system that these bytes were valid CBOR. Unfortunately: - This is incorrect and will break once we actually start enforcing this. - This makes it _very_ difficult to test the EVM because we have quite a bit of testing code that assumes CBOR. The long-term solution is to correctly handle IPLD (see #758). But the short-term solution is to just encode/decode parameters as CBOR.
Stebalien
added a commit
that referenced
this issue
Oct 18, 2022
The previous code was passing parameters as raw bytes, but telling the system that these bytes were valid CBOR. Unfortunately: - This is incorrect and will break once we actually start enforcing this. - This makes it _very_ difficult to test the EVM because we have quite a bit of testing code that assumes CBOR. The long-term solution is to correctly handle IPLD (see #758). But the short-term solution is to just encode/decode parameters as CBOR.
Stebalien
added a commit
that referenced
this issue
Oct 19, 2022
* fix: encode/decode EVM parameters as CBOR The previous code was passing parameters as raw bytes, but telling the system that these bytes were valid CBOR. Unfortunately: - This is incorrect and will break once we actually start enforcing this. - This makes it _very_ difficult to test the EVM because we have quite a bit of testing code that assumes CBOR. The long-term solution is to correctly handle IPLD (see #758). But the short-term solution is to just encode/decode parameters as CBOR. * fix: only use RawBytes for CBOR "RawBytes" is for storing serialized CBOR (per the docs). Any other uses are bugs.
This was referenced Nov 27, 2022
Repository owner
moved this from 🏗 In progress
to ✅ Done
in Network v18
Dec 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the actor's runtime passes around
RawBytes
which are assumed to be CBOR (or "nothing" if empty). However:RawBytes
for this, but that's not actually valid CBOR.Proposal: Introduce a new
IpldBlock
type and change the runtime/actor methods to useOption<IpldBlock>
in parameters and return values (instead ofRawBytes
).To avoid having to make too many manual changes up front, I'm proposing the following "tooling assisted" upgrade path:
Runtime::send
toRuntime::send_cbor
.ActorCode::invoke_method
toActorCode::invoke_method_cbor
.Runtime::send
, makingRuntime::send_cbor
a special case that only handles cbor.ActorCode::invoke_method
call that delegates toActorCode::invoke_method_cbor
by default.This will create a fairly large diff, but shouldn't require too much manual work.
The text was updated successfully, but these errors were encountered: