Closed nagisa closed 1 year ago
near-crypto
and near-primitives-core
are a difficult dependency to remove. Specifically near_crypto::PublicKey
appears in interfaces exposed to the contracts (we better take full control of that!) and near-primitives-core
is just a leaf crate with a bunch of stuff in it that doesn’t necessarily impact the operation of VM too much.
I think it is worthwhile to duplicate the few relevant parts of near-crypto
into near-vm-runner as an internal implementation detail where necessary. And near-primitives-core
is probably staying as a regular dependency, since it defines some types that are being used in the interface. That said at least a couple action items with regards to this dependency:
checked_feature!
and anything else protocol versioning related – it needs to become a runtime managed flag in the public VM configuration somehow, so that the binding layer can propagate this information to the "base" implementation in the world where limited replayability exists.VMLimitConfig
, ContractCode
and other VM-specific structures into near-vm-runner
and export them from there.The tracking of the remaining outstanding work has moved over to https://github.com/near/nearcore/issues/9383 for the August.
This is a portion of the #8197 intended to track (for the purposes of having an issue to attach to a milestone) a part of the work involved in achieving the desired result.
The scope of this work is to remove crate dependency edges from
near-vm-runner
crate to othernear-
crates in the workspace that couldn’t conceivably be part of the initial limited replayability MVP. In particularhttps://github.com/near/nearcore/blob/347339d8abb116c65e60667b8a4facced8bbd469/runtime/near-vm-runner/Cargo.toml#L39-L42
should disappear.
As part of this task we’ve realized we’d like to set up protocol schemas in a single place such that they aren’t spread out across the crate graph as much as well. Most importantly, though, these schemas would ideally become a part of the limited replayability story, even if they are part of e.g. the chain crate right now, which would allow us to modify the encoding of data on the blockchain as the protocol versions change more easily.