Fix a few small but protocol-breaking metering issues discovered by the security review:
i. auth entry charging the wrong amount https://github.com/stellar/rs-soroban-env/issues/1297
ii. (not protocol breaking) auth snapshot() function charge after allocation
iii. auth manager not charging RefCell wrapping.
I also did a clean up by wrapping the with_capacity method with metering into a new MeteredContainer::with_metered_capacity method, which makes sure bugs like (i) and (ii) above cannot happen.
Unfortunately these breaks a lot of existing observations that depends on auth, basically all mem_bytes have increased by 8 (size of the RefCell counter) and cpu_insns have increased by 2, which is caused by fixing (iii).
Why
[TODO: Why this change is being made. Include any context required to understand the why.]
What
Fix a few small but protocol-breaking metering issues discovered by the security review: i. auth entry charging the wrong amount https://github.com/stellar/rs-soroban-env/issues/1297 ii. (not protocol breaking) auth
snapshot()
function charge after allocation iii. auth manager not chargingRefCell
wrapping.I also did a clean up by wrapping the
with_capacity
method with metering into a newMeteredContainer::with_metered_capacity
method, which makes sure bugs like (i) and (ii) above cannot happen.Unfortunately these breaks a lot of existing observations that depends on auth, basically all
mem_bytes
have increased by 8 (size of the RefCell counter) andcpu_insns
have increased by 2, which is caused by fixing (iii).Why
[TODO: Why this change is being made. Include any context required to understand the why.]
Known limitations
[TODO or N/A]