rs-soroban-env icon indicating copy to clipboard operation
rs-soroban-env copied to clipboard

Native test contract frames actually could do relative object translation

Open graydon opened this issue 1 year ago • 0 comments

Currently native test contracts don't do relative-to-absolute object handle translation the way VM frames do. In this way they lack a degree of fidelity with VM frames. When I initially implemented it I somehow forgot there actually is a central place we could do this, in the impl <T:VmCallerEnv> Env for T macro-generated impl in vmcaller_env.rs in common.

This is not a security issue nor a breaking change for any contracts in the wild. It would change the observable semantics of a small part of test contracts that you really shouldn't be looking at anyways (object numbers) while improving fidelity between VM and native testing (in terms of cost model accuracy and object numbers in case you were looking). So we should probably do it at some point in the future. But it doesn't have to happen right now.

graydon avatar Dec 03 '23 01:12 graydon