You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a talk with @cheme about externalities, it appears that a lot of the optional host functions that can be used in some context and not others are declared as:
#[cfg(feature = "std")]
sp_externalities::decl_extension! {
/// An externalities extension to submit transactions to the pool.
pub struct TransactionPoolExt(Box<dyn TransactionPool + Send>);
}
But it seems like the benchmarking code is declared right into the main trait Externalities.
Why is this? could it have been done otherwise?
The text was updated successfully, but these errors were encountered:
No. It currently could not. The problem is that you need access to the overlay and that overlay is already part of the object that implements the externalities crate. However, if we move everything over to just use extensions, we probably could do the switch for benchmarking to have their own extension and I would like this.
We could try feature gating them at least. But that would introduce the runtime-benchmarks feature into some crates which normally dont have it, like sp-state-machine.
Do you think its worth it?
Having a talk with @cheme about externalities, it appears that a lot of the optional host functions that can be used in some context and not others are declared as:
But it seems like the benchmarking code is declared right into the main
trait Externalities
.Why is this? could it have been done otherwise?
The text was updated successfully, but these errors were encountered: