@@ -52,6 +52,8 @@ pub struct JournaledState<DB> {
5252 /// Note that this not include newly loaded accounts, account and storage
5353 /// is considered warm if it is found in the `State`.
5454 pub warm_preloaded_addresses : HashSet < Address > ,
55+ /// Precompile addresses
56+ pub precompiles : HashSet < Address > ,
5557}
5658
5759impl < DB : Database > Journal for JournaledState < DB > {
@@ -63,11 +65,11 @@ impl<DB: Database> Journal for JournaledState<DB> {
6365 Self :: new ( SpecId :: LATEST , database)
6466 }
6567
66- fn db ( & self ) -> & Self :: Database {
68+ fn db_ref ( & self ) -> & Self :: Database {
6769 & self . database
6870 }
6971
70- fn db_mut ( & mut self ) -> & mut Self :: Database {
72+ fn db ( & mut self ) -> & mut Self :: Database {
7173 & mut self . database
7274 }
7375
@@ -112,6 +114,17 @@ impl<DB: Database> Journal for JournaledState<DB> {
112114 self . warm_preloaded_addresses . insert ( address) ;
113115 }
114116
117+ fn warm_precompiles ( & mut self , address : HashSet < Address > ) {
118+ self . precompiles = address;
119+ self . warm_preloaded_addresses
120+ . extend ( self . precompiles . iter ( ) ) ;
121+ }
122+
123+ #[ inline]
124+ fn precompile_addresses ( & self ) -> & HashSet < Address > {
125+ & self . precompiles
126+ }
127+
115128 /// Returns call depth.
116129 #[ inline]
117130 fn depth ( & self ) -> usize {
@@ -212,6 +225,7 @@ impl<DB: Database> Journal for JournaledState<DB> {
212225 spec : _,
213226 database : _,
214227 warm_preloaded_addresses : _,
228+ precompiles : _,
215229 } = self ;
216230
217231 * transient_storage = TransientStorage :: default ( ) ;
@@ -243,6 +257,7 @@ impl<DB: Database> JournaledState<DB> {
243257 depth : 0 ,
244258 spec,
245259 warm_preloaded_addresses : HashSet :: default ( ) ,
260+ precompiles : HashSet :: default ( ) ,
246261 }
247262 }
248263
0 commit comments