sui icon indicating copy to clipboard operation
sui copied to clipboard

Move expensive_check_sui_conservation to node init

Open dariorussi opened this issue 1 year ago • 11 comments

Description

As titled. @lxfind this should help to retrieve type layout in a safer way (second commit here). Please let us know if you see any issue with that

Test Plan

Existing tests


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • [ ] user-visible impact
  • [ ] breaking change for a client SDKs
  • [ ] breaking change for FNs (FN binary must upgrade)
  • [ ] breaking change for validators or node operators (must upgrade binaries)
  • [ ] breaking change for on-chain data layout
  • [ ] necessitate either a data wipe or data migration

Release notes

dariorussi avatar Apr 30 '23 22:04 dariorussi

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) May 10, 2023 10:14pm
explorer-storybook ⬜️ Ignored (Inspect) May 10, 2023 10:14pm
sui-wallet-kit ⬜️ Ignored (Inspect) May 10, 2023 10:14pm
wallet-adapter ⬜️ Ignored (Inspect) May 10, 2023 10:14pm

vercel[bot] avatar Apr 30 '23 22:04 vercel[bot]

(The change to introduce the new Session API is otherwise good though)

amnn avatar Apr 30 '23 23:04 amnn

I assume we cannot just create a new VM on-the-fly for the conservation check?

lxfind avatar May 01 '23 00:05 lxfind

By the way, the primary conservation check is in fact called during reconfiguration. The one at genesis is just to initialize it. We will need to deal with both if we need to make changes.

lxfind avatar May 01 '23 00:05 lxfind

By the way, the primary conservation check is in fact called during reconfiguration. The one at genesis is just to initialize it. We will need to deal with both if we need to make changes.

correct and the one in reconfiguration is in authority so with "easy" access to the VM. The call while creating the AuthorityStore is the "complicated" one

dariorussi avatar May 01 '23 00:05 dariorussi

made a change to create perpetual tables outside the AuthorityStore, let's see if it seems reasonable. Thanks!

dariorussi avatar May 01 '23 00:05 dariorussi

I assume we cannot just create a new VM on-the-fly for the conservation check?

We can do this, but then it may involve doing a lot of extra work to load the relevant packages into the VM during the conservation check that we would otherwise avoid by using the same VM.

amnn avatar May 01 '23 00:05 amnn

I assume we cannot just create a new VM on-the-fly for the conservation check?

We can do this, but then it may involve doing a lot of extra work to load the relevant packages into the VM during the conservation check that we would otherwise avoid by using the same VM.

right, as @amnn said we thought it was a bit too much and it was nice to use the same VM as what is created for the authority state. It also played a role that the solution we are implementing is a "temporary" solution until we review the layout story entirely

dariorussi avatar May 01 '23 00:05 dariorussi

We can do this, but then it may involve doing a lot of extra work to load the relevant packages into the VM during the conservation check that we would otherwise avoid by using the same VM.

It uses an internal module cache so it might not be too bad

lxfind avatar May 01 '23 00:05 lxfind

It does, but it will entirely replicate that inside the VM, multiple times over.

amnn avatar May 01 '23 00:05 amnn

Looks reasonable change to me. Now that we have empty_table outside there, I wonder if it could be used to simplify other things (not sure, but worth a quick check)

let's chat tomorrow about it as I keep going with the implementation of the overall change. We will also take a look at what else could be simplified

dariorussi avatar May 01 '23 00:05 dariorussi

ok this is ready so let's try to get a review and make sure everything is good

dariorussi avatar May 09 '23 23:05 dariorussi

made suggested changes unless otherwise commented

dariorussi avatar May 10 '23 19:05 dariorussi