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
Splitting the runtime into a "transaction runtime" and the "full runtime".
Splitting the blockstore into a read/write half.
traitReadStore{fnget(&self,mh_code:Code,block:&Block) -> Result<Cid>;}traitWriteStore:ReadStore{fnput(&self,mh_code:Code,block:&Block) -> Result<Cid>;}traitTransactionRuntime{typeWriteStore:WriteStore;typeReadStore:ReadStore;// Reading state is always fine.fnstate<C:Cbor>(&self) -> Result<C,ActorError>;fnstore(&self) -> Result<&Self::ReadStore,ActorError>;fnresolve_address(&self,address:&Address) -> Option<Address>;fncurrent_balance(&self) -> TokenAmount;// etc...}traitFullRuntime:TransactionRuntime{typeTransactionRuntime:TransactionRuntime;// 1. Inside the closure, the actor cannot use the FullRuntime// (cannot send, cannot open new transactions).// 2. Outside the closure, the actor cannot create new blocks. The actor cannot// keep a reference to the writeable blockstore either.fntransaction<R>(&mutself,f:implFnOnce(&mutSelf::TransactionRuntime,&Self::WriteStore,&mutimplCbor,) -> Result<R,ActorError>,);// Cannot be called in a transaction.fnsend(&mutself,to:Address,method:MethodNum,params:RawBytes,value:TokenAmount,) -> Result<RawBytes,ActorError>;}
The text was updated successfully, but these errors were encountered:
We can get better guarantees in rust by;
The text was updated successfully, but these errors were encountered: