[go: up one dir, main page]

RISC-V: Make struct_layout! use Merkle-isastion

Closes RV-524

What

Change the implementations generated by the struct_layout macro to use Merklisation over its sub-layouts.

Why

I want to use this macro as part of the Supervisor work where the state layouts become quite bloated. However, this macro needs to be fixed first.

How

The struct_layout macro generates a layout functor type (indicated by the trailing F its name). That functor is parametric over its field types.

Constraining the field types instead of the sub-layouts simplifies the impls generated by the macro.

With this simplification, correcting the implementations was much easier.

Manually Testing

cargo test --lib struct_layout

Benchmarking

No performance impact has been detected.

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Put in reasonable effort to ensure that CI will pass.
    • make -C src/riscv
    • dune build src/lib_riscv
    • dune build src/rust_deps
  • Benchmark performance and populate the table above if needed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages to reflect the changes they're about.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.
Edited by Ole Krüger

Merge request reports

Loading