[go: up one dir, main page]

Rust SDK: Do not use `store_has` in the happy path

Some (most?) function from the Runtime trait are calling store_has on the input path before doing anything. In practice, this adds an overhead in every execution branches, even in the ones where the return of the next host function is enough te deduce the correct error to return.

In this patch, we propose to delay the call to store_has to only when it is needed. This is the approach implemented in the native execution runtime, and we have replayed the full history of Bifrost on Mainnet as evidence that the semantics is correct.

Manually testing the MR

CI shall prevail? normally, it should be a no-op change as far as semantics is concerned.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Thomas Letan

Merge request reports

Loading