Specification of the aggregate instructions clash with the intended behaviour #7
Labels
A-docs
Area: the documentation of this crate.
A-gas-analysis
Area: the gas analysis implemented in this crate
So today the spec for executing
memory.fill
and such says something along the lines of:The problem is that this operation reduces to multiple other plain instructions such as
i32.store8
andmemory.fill
. With how our specification is written, this will effectively causememory.fill
to charge at least𝑛
times thefee(i32.store8)
plus𝑛
times thefee(memory.fill)
. In the implementation itself this will probably be a regularmemset
and therefore run at different speeds depending on the𝑛
.The most straightforward option that came up as an idea is to, first, specify
fee
as pattern matching on sequence of instructions and their reductions rather than executed instruction. That is, forn=3
it would see something likeand we would be able to “pattern” match this specific thing as a a
memory.fill
of size𝑛
and return a corresponding fee (while all of thei32.store8
s this reduces to internally would now be “free” since calculating the fee for the whole aggregate does not recurse)The text was updated successfully, but these errors were encountered: