Skip to content

Commit

Permalink
fix: make the empty array CID const and export it (filecoin-project#668)
Browse files Browse the repository at this point in the history
Otherwise, we'll perform a hash in WASM when we first dereference (max
once per call) which is just wasteful.

This also fixes the integration tests to use the "correct" empty object.
Previously, they were using `()` which mapped to null, not `[]`.
  • Loading branch information
Stebalien authored and shamb0 committed Oct 3, 2022
1 parent 752c46e commit e1bdaf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ pub(crate) mod hash_algorithm;
pub(crate) mod empty;
pub use empty::EMPTY_ARR_CID;

pub(crate) mod empty;
pub use empty::EMPTY_ARR_CID;

/// Runtime is the VM's internal runtime object.
/// this is everything that is accessible to actors, beyond parameters.
pub trait Runtime<BS: Blockstore>: Primitives + Verifier + RuntimePolicy {
Expand Down

0 comments on commit e1bdaf3

Please sign in to comment.