Skip to content

Conversation

@LucasSte
Copy link
Collaborator

@LucasSte LucasSte commented May 29, 2025

Summary of changes

  1. Since we were no declaring memory regions addresses in the monorepo, I added new constants for the new regions introduced in ABIv2.
  2. Update the message in the errors, so that we surface the region name in SBPFv3 for easier debugging.
  3. Fix tests that failed with the different string in the error.

@LucasSte LucasSte force-pushed the change-naming branch 2 times, most recently from a721452 to 0b1cdf8 Compare June 3, 2025 17:29
@LucasSte LucasSte changed the title Update memory region names in errors Update memory region names Jun 3, 2025
@LucasSte LucasSte requested a review from Lichtso June 3, 2025 17:38
@LucasSte LucasSte marked this pull request as ready for review June 3, 2025 17:38
pub const MM_STACK_START: u64 = MM_REGION_SIZE * 2;
/// Virtual address of the heap region
pub const MM_HEAP_START: u64 = MM_REGION_SIZE * 3;
/// Virtual address of the input region
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't "Input" be renamed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not rename it, because it is still the same. Should it be called MM_TX_INPUT_START?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Input" is kinda a useless name because it does not say from where to where, it is subjective depending on the perspective, like "left" and "right". Maybe MM_TX_AREA, MM_TX_INSTRUCTION_AREA and MM_TX_INSTRUCTION_DATA.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then again, we probably want multiple instructions mapped in at once. So MM_TX_INSTRUCTION_DATA might not cut it either.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then again, we probably want multiple instructions mapped in at once.

Even if we follow that path, the most important instruction for a program is the one being executed, so having that one in a predicted address that can be read without any other dependencies is preferable. The SDK could then access other instructions on demand.

@LucasSte LucasSte requested a review from Lichtso June 11, 2025 14:22
src/ebpf.rs Outdated
pub const MM_INPUT_START: u64 = MM_REGION_SIZE * 4;
pub const MM_TX_AREA: u64 = MM_REGION_SIZE * 4;
/// Virtual address of the scratch pad area
pub const MM_SCRATCHPAD_AREA: u64 = MM_REGION_SIZE * 5;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read the SIMD again, and I think I made a mistake calling this "scratchpad". We should stick with the current naming of this being "return-data".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated all names according to the latest version of the SIMD in 8ba1d93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants