Skip to content

Conversation

aman4150
Copy link
Collaborator

...since ro_data and rw_data are already part of the ProgramBlob.

Copy link
Collaborator

@koute koute left a comment

Choose a reason for hiding this comment

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

Technically the ro_data here is still unnecessary because that is part of the RO blob too, but it is an improvement nonetheless.

If we want to absolutely minimize the memory usage we could get rid of ro_data too, but that is a little tricky to do because of the extra padding, so any access at the boundary would have to be special-cased. Basically:

  1. any access within 0..ro_data.len() - 8 would work the same as it does now,
  2. ro_data.len()..ro_data.len() would have to be special-cased to first initialize an 8-byte array with zeros, copy the initial bytes, and then return a reference to that array in the get slice function,
  3. ro_data.len()..ro_data_len would be special-cased to return zeros

But this would be pretty ugly, hm.... okay, let's maybe leave it as-is.

...since ro_data and rw_data are already part of the ProgramBlob.

Signed-off-by: Aman <[email protected]>
@aman4150 aman4150 enabled auto-merge (rebase) September 2, 2025 10:39
@aman4150 aman4150 merged commit 660926e into paritytech:master Sep 2, 2025
12 checks passed
@aman4150 aman4150 deleted the minor-fixes branch September 2, 2025 11:18
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