-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Change MaxMemorySize
to MaxMemoryPages
#6728
Conversation
We should set the max memory for the executor in pages (64KiB) and not in bytes. The wasm memory is always a multiple of a page and we should use the same terminology.
I don't have a strong opinion if it's beneficial or not. Substrate executor deals with paging issues itself where needed, and external Wastime interfaces often use bytes to represent different types of limits (e.g. I mean, @koute any thoughts from you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Even if some of wasmtime
's interfaces take a number of bytes instead of a number of pages (for convenience's sake I suppose) it doesn't change the fact that WASM memory can only grow in page increments, so it makes sense to define the limit also in page increments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd anyway consider changing that on the Substrate executor side for the sake of consistency, otherwise looks good.
The change is already coming here: #6730 This is the reason I have opened this pr :D |
We should set the max memory for the executor in pages (64KiB) and not in bytes. The wasm memory is always a multiple of a page and we should use the same terminology.
Sorry to not have brought up this earlier 🙈 I just realized while doing some other things 🙈