@@ -119,7 +119,8 @@ lazy_static! {
119
119
. collect( ) ,
120
120
121
121
gas_per_exec_unit: 0 ,
122
- extern_traversal_cost: 0 ,
122
+ get_randomness_base: 0 ,
123
+ get_randomness_per_byte: 0 ,
123
124
124
125
block_memcpy_per_byte_cost: 0 ,
125
126
block_io_per_byte_cost: 0 ,
@@ -204,6 +205,7 @@ lazy_static! {
204
205
. cloned( )
205
206
. collect( ) ,
206
207
208
+ // TODO: PARAM_FINISH: this may need to be increased to account for the cost of an extern
207
209
verify_consensus_fault: 495422 ,
208
210
verify_replica_update: 36316136 ,
209
211
verify_post_lookup: [
@@ -241,7 +243,10 @@ lazy_static! {
241
243
// TODO: PARAM_FINISH
242
244
gas_per_exec_unit: 2 ,
243
245
// TODO: PARAM_FINISH
244
- extern_traversal_cost: 1 ,
246
+ get_randomness_base: 1 ,
247
+ // TODO: PARAM_FINISH
248
+ get_randomness_per_byte: 1 ,
249
+
245
250
// TODO: PARAM_FINIuiSH
246
251
block_open_base: 1 ,
247
252
// TODO: PARAM_FINISH
@@ -364,9 +369,8 @@ pub struct PriceList {
364
369
// 1 Exec Unit = gas_per_exec_unit * 1 Gas
365
370
pub ( crate ) gas_per_exec_unit : i64 ,
366
371
367
- // A special cost for traversing the boundary between the FVM and the client node
368
- // See https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0032.md#extern-traversing-syscall-fee-revision for more
369
- pub ( crate ) extern_traversal_cost : i64 ,
372
+ pub ( crate ) get_randomness_base : i64 ,
373
+ pub ( crate ) get_randomness_per_byte : i64 ,
370
374
371
375
pub ( crate ) block_memcpy_per_byte_cost : i64 ,
372
376
pub ( crate ) block_io_per_byte_cost : i64 ,
@@ -560,10 +564,21 @@ impl PriceList {
560
564
}
561
565
}
562
566
563
- /// Returns the gas required for traversing an extern boundary into the client.
567
+ /// Returns the base cost of the gas required for getting randomness from the client.
568
+ #[ inline]
569
+ pub fn on_get_randomness_base ( & self ) -> GasCharge < ' static > {
570
+ GasCharge :: new ( "OnGetRandomnessBase" , self . get_randomness_base , 0 )
571
+ }
572
+
573
+ /// Returns the gas required for getting randomness from the client based on the number of bytes of randomness.
564
574
#[ inline]
565
- pub fn on_extern_traversal ( & self ) -> GasCharge < ' static > {
566
- GasCharge :: new ( "OnExternTraversal" , self . extern_traversal_cost , 0 )
575
+ pub fn on_get_randomness_per_byte ( & self , randomness_size : usize ) -> GasCharge < ' static > {
576
+ GasCharge :: new (
577
+ "OnGetRandomnessPerByte" ,
578
+ self . get_randomness_per_byte
579
+ . saturating_mul ( randomness_size as i64 ) ,
580
+ 0 ,
581
+ )
567
582
}
568
583
569
584
/// Returns the base gas required for loading an object, independent of the object's size.
0 commit comments