@@ -18,6 +18,8 @@ pub struct ForkSpec {
1818 pub epoch_length : u64 ,
1919 /// Max turn length
2020 pub max_turn_length : u64 ,
21+ /// Gas Limit bound diriver
22+ pub gas_limit_bound_divider : u64 ,
2123}
2224
2325impl ForkSpec {
@@ -182,6 +184,7 @@ impl TryFrom<RawForkSpec> for ForkSpec {
182184 additional_header_item_count : value. additional_header_item_count ,
183185 epoch_length : value. epoch_length ,
184186 max_turn_length : value. max_turn_length ,
187+ gas_limit_bound_divider : value. gas_limit_bound_divider ,
185188 } )
186189 }
187190}
@@ -198,6 +201,7 @@ impl From<ForkSpec> for RawForkSpec {
198201 additional_header_item_count : value. additional_header_item_count ,
199202 epoch_length : value. epoch_length ,
200203 max_turn_length : value. max_turn_length ,
204+ gas_limit_bound_divider : value. gas_limit_bound_divider ,
201205 }
202206 }
203207}
@@ -290,12 +294,14 @@ mod test {
290294 additional_header_item_count : 1 ,
291295 epoch_length : 200 ,
292296 max_turn_length : 9 ,
297+ gas_limit_bound_divider : 256 ,
293298 } ,
294299 ForkSpec {
295300 height_or_timestamp : HeightOrTimestamp :: Height ( 20 ) ,
296301 additional_header_item_count : 2 ,
297302 epoch_length : 200 ,
298303 max_turn_length : 9 ,
304+ gas_limit_bound_divider : 256 ,
299305 } ,
300306 ] ;
301307 let v = find_target_fork_spec ( specs, 10 , 0 ) . unwrap ( ) ;
@@ -316,12 +322,14 @@ mod test {
316322 additional_header_item_count : 1 ,
317323 epoch_length : 200 ,
318324 max_turn_length : 9 ,
325+ gas_limit_bound_divider : 256 ,
319326 } ,
320327 ForkSpec {
321328 height_or_timestamp : HeightOrTimestamp :: Time ( 20 ) ,
322329 additional_header_item_count : 2 ,
323330 epoch_length : 200 ,
324331 max_turn_length : 9 ,
332+ gas_limit_bound_divider : 256 ,
325333 } ,
326334 ] ;
327335 let v = find_target_fork_spec ( specs, 0 , 10 ) . unwrap ( ) ;
@@ -342,12 +350,14 @@ mod test {
342350 additional_header_item_count : 1 ,
343351 epoch_length : 200 ,
344352 max_turn_length : 9 ,
353+ gas_limit_bound_divider : 256 ,
345354 } ,
346355 ForkSpec {
347356 height_or_timestamp : HeightOrTimestamp :: Time ( 10 ) ,
348357 additional_header_item_count : 20 ,
349358 epoch_length : 200 ,
350359 max_turn_length : 9 ,
360+ gas_limit_bound_divider : 256 ,
351361 } ,
352362 ] ;
353363 // After value is primary
@@ -369,12 +379,14 @@ mod test {
369379 additional_header_item_count : 1 ,
370380 epoch_length : 200 ,
371381 max_turn_length : 9 ,
382+ gas_limit_bound_divider : 256 ,
372383 } ,
373384 ForkSpec {
374385 height_or_timestamp : HeightOrTimestamp :: Height ( 20 ) ,
375386 additional_header_item_count : 2 ,
376387 epoch_length : 200 ,
377388 max_turn_length : 9 ,
389+ gas_limit_bound_divider : 256 ,
378390 } ,
379391 ] ;
380392 let v = find_target_fork_spec ( specs, 9 , 0 ) . unwrap_err ( ) ;
@@ -395,12 +407,14 @@ mod test {
395407 additional_header_item_count : 1 ,
396408 epoch_length : 200 ,
397409 max_turn_length : 9 ,
410+ gas_limit_bound_divider : 256 ,
398411 } ,
399412 ForkSpec {
400413 height_or_timestamp : HeightOrTimestamp :: Time ( 20 ) ,
401414 additional_header_item_count : 2 ,
402415 epoch_length : 200 ,
403416 max_turn_length : 9 ,
417+ gas_limit_bound_divider : 256 ,
404418 } ,
405419 ] ;
406420 let v = find_target_fork_spec ( specs, 0 , 9 ) . unwrap_err ( ) ;
@@ -421,12 +435,14 @@ mod test {
421435 additional_header_item_count : 1 ,
422436 epoch_length : 200 ,
423437 max_turn_length : 9 ,
438+ gas_limit_bound_divider : 256 ,
424439 } ,
425440 ForkSpec {
426441 height_or_timestamp : HeightOrTimestamp :: Time ( 10 ) ,
427442 additional_header_item_count : 2 ,
428443 epoch_length : 200 ,
429444 max_turn_length : 9 ,
445+ gas_limit_bound_divider : 256 ,
430446 } ,
431447 ] ;
432448 let v = find_target_fork_spec ( specs, 9 , 9 ) . unwrap_err ( ) ;
@@ -447,12 +463,14 @@ mod test {
447463 additional_header_item_count : 1 ,
448464 epoch_length : 200 ,
449465 max_turn_length : 9 ,
466+ gas_limit_bound_divider : 256 ,
450467 } ,
451468 ForkSpec {
452469 height_or_timestamp : HeightOrTimestamp :: Height ( 11 ) ,
453470 additional_header_item_count : 2 ,
454471 epoch_length : 200 ,
455472 max_turn_length : 9 ,
473+ gas_limit_bound_divider : 256 ,
456474 } ,
457475 ] ;
458476 verify_sorted_asc ( specs) . unwrap ( ) ;
@@ -466,12 +484,14 @@ mod test {
466484 additional_header_item_count : 1 ,
467485 epoch_length : 200 ,
468486 max_turn_length : 9 ,
487+ gas_limit_bound_divider : 256 ,
469488 } ,
470489 ForkSpec {
471490 height_or_timestamp : HeightOrTimestamp :: Time ( 11 ) ,
472491 additional_header_item_count : 2 ,
473492 epoch_length : 200 ,
474493 max_turn_length : 9 ,
494+ gas_limit_bound_divider : 256 ,
475495 } ,
476496 ] ;
477497 verify_sorted_asc ( specs) . unwrap ( ) ;
@@ -485,12 +505,14 @@ mod test {
485505 additional_header_item_count : 1 ,
486506 epoch_length : 200 ,
487507 max_turn_length : 9 ,
508+ gas_limit_bound_divider : 256 ,
488509 } ,
489510 ForkSpec {
490511 height_or_timestamp : HeightOrTimestamp :: Height ( 10 ) ,
491512 additional_header_item_count : 2 ,
492513 epoch_length : 200 ,
493514 max_turn_length : 9 ,
515+ gas_limit_bound_divider : 256 ,
494516 } ,
495517 ] ;
496518 let v = verify_sorted_asc ( specs) . unwrap_err ( ) ;
@@ -508,12 +530,14 @@ mod test {
508530 additional_header_item_count : 1 ,
509531 epoch_length : 200 ,
510532 max_turn_length : 9 ,
533+ gas_limit_bound_divider : 256 ,
511534 } ,
512535 ForkSpec {
513536 height_or_timestamp : HeightOrTimestamp :: Height ( 10 ) ,
514537 additional_header_item_count : 2 ,
515538 epoch_length : 200 ,
516539 max_turn_length : 9 ,
540+ gas_limit_bound_divider : 256 ,
517541 } ,
518542 ] ;
519543 let v = verify_sorted_asc ( specs) . unwrap_err ( ) ;
@@ -534,12 +558,14 @@ mod test {
534558 additional_header_item_count : 1 ,
535559 epoch_length : 200 ,
536560 max_turn_length : 9 ,
561+ gas_limit_bound_divider : 256 ,
537562 } ,
538563 ForkSpec {
539564 height_or_timestamp : HeightOrTimestamp :: Time ( 10 ) ,
540565 additional_header_item_count : 2 ,
541566 epoch_length : 200 ,
542567 max_turn_length : 9 ,
568+ gas_limit_bound_divider : 256 ,
543569 } ,
544570 ] ;
545571 let v = verify_sorted_asc ( specs) . unwrap_err ( ) ;
@@ -557,12 +583,14 @@ mod test {
557583 additional_header_item_count : 1 ,
558584 epoch_length : 200 ,
559585 max_turn_length : 9 ,
586+ gas_limit_bound_divider : 256 ,
560587 } ,
561588 ForkSpec {
562589 height_or_timestamp : HeightOrTimestamp :: Time ( 10 ) ,
563590 additional_header_item_count : 2 ,
564591 epoch_length : 200 ,
565592 max_turn_length : 9 ,
593+ gas_limit_bound_divider : 256 ,
566594 } ,
567595 ] ;
568596 let v = verify_sorted_asc ( specs) . unwrap_err ( ) ;
@@ -582,6 +610,7 @@ mod test {
582610 additional_header_item_count : 1 ,
583611 epoch_length : 500 ,
584612 max_turn_length : 64 ,
613+ gas_limit_bound_divider : 256 ,
585614 } ;
586615 match current
587616 . boundary_epochs ( & fork_spec_after_pascal ( ) )
@@ -705,12 +734,14 @@ mod test {
705734 additional_header_item_count : 1 ,
706735 epoch_length : 200 ,
707736 max_turn_length : 9 ,
737+ gas_limit_bound_divider : 256 ,
708738 } ,
709739 ForkSpec {
710740 height_or_timestamp : HeightOrTimestamp :: Height ( 20 ) ,
711741 additional_header_item_count : 2 ,
712742 epoch_length : 200 ,
713743 max_turn_length : 9 ,
744+ gas_limit_bound_divider : 256 ,
714745 } ,
715746 ] ;
716747 let v = get_boundary_epochs ( & fork_spec_after_pascal ( ) , specs) . unwrap_err ( ) ;
@@ -730,12 +761,14 @@ mod test {
730761 additional_header_item_count : 1 ,
731762 epoch_length : 200 ,
732763 max_turn_length : 9 ,
764+ gas_limit_bound_divider : 256 ,
733765 } ,
734766 ForkSpec {
735767 height_or_timestamp : HeightOrTimestamp :: Height ( 20 ) ,
736768 additional_header_item_count : 2 ,
737769 epoch_length : 500 ,
738770 max_turn_length : 9 ,
771+ gas_limit_bound_divider : 256 ,
739772 } ,
740773 ] ;
741774 let v = get_boundary_epochs ( & specs[ 1 ] , specs) . unwrap ( ) ;
0 commit comments