@@ -308,31 +308,28 @@ impl ZerostateConfig {
308
308
let mut shards = Vec :: new ( ) ;
309
309
for entry in workchains. iter ( ) {
310
310
let ( workchain, descr) = entry?;
311
- shards. push ( (
312
- ShardIdent :: new_full ( workchain) ,
313
- ShardDescription {
314
- seqno : 0 ,
315
- reg_mc_seqno : 0 ,
316
- start_lt : 0 ,
317
- end_lt : 0 ,
318
- root_hash : descr. zerostate_root_hash ,
319
- file_hash : descr. zerostate_file_hash ,
320
- before_split : false ,
321
- before_merge : false ,
322
- want_split : false ,
323
- want_merge : false ,
324
- nx_cc_updated : true ,
325
- next_catchain_seqno : 0 ,
326
- next_validator_shard : ShardIdent :: PREFIX_FULL ,
327
- min_ref_mc_seqno : u32:: MAX ,
328
- gen_utime : now,
329
- split_merge_at : None ,
330
- fees_collected : CurrencyCollection :: ZERO ,
331
- funds_created : CurrencyCollection :: ZERO ,
332
- copyleft_rewards : Dict :: new ( ) ,
333
- proof_chain : None ,
334
- } ,
335
- ) ) ;
311
+ shards. push ( ( ShardIdent :: new_full ( workchain) , ShardDescription {
312
+ seqno : 0 ,
313
+ reg_mc_seqno : 0 ,
314
+ start_lt : 0 ,
315
+ end_lt : 0 ,
316
+ root_hash : descr. zerostate_root_hash ,
317
+ file_hash : descr. zerostate_file_hash ,
318
+ before_split : false ,
319
+ before_merge : false ,
320
+ want_split : false ,
321
+ want_merge : false ,
322
+ nx_cc_updated : true ,
323
+ next_catchain_seqno : 0 ,
324
+ next_validator_shard : ShardIdent :: PREFIX_FULL ,
325
+ min_ref_mc_seqno : u32:: MAX ,
326
+ gen_utime : now,
327
+ split_merge_at : None ,
328
+ fees_collected : CurrencyCollection :: ZERO ,
329
+ funds_created : CurrencyCollection :: ZERO ,
330
+ copyleft_rewards : Dict :: new ( ) ,
331
+ proof_chain : None ,
332
+ } ) ) ;
336
333
}
337
334
338
335
state. custom = Some ( Lazy :: new ( & McStateExtra {
@@ -442,24 +439,21 @@ fn make_default_params() -> Result<BlockchainConfigParams> {
442
439
// Param 12
443
440
{
444
441
let mut workchains = Dict :: new ( ) ;
445
- workchains. set (
446
- 0 ,
447
- WorkchainDescription {
448
- enabled_since : 0 ,
449
- actual_min_split : 0 ,
450
- min_split : 0 ,
451
- max_split : 3 ,
452
- active : true ,
453
- accept_msgs : true ,
454
- zerostate_root_hash : HashBytes :: ZERO ,
455
- zerostate_file_hash : HashBytes :: ZERO ,
456
- version : 0 ,
457
- format : WorkchainFormat :: Basic ( WorkchainFormatBasic {
458
- vm_version : 0 ,
459
- vm_mode : 0 ,
460
- } ) ,
461
- } ,
462
- ) ?;
442
+ workchains. set ( 0 , WorkchainDescription {
443
+ enabled_since : 0 ,
444
+ actual_min_split : 0 ,
445
+ min_split : 0 ,
446
+ max_split : 3 ,
447
+ active : true ,
448
+ accept_msgs : true ,
449
+ zerostate_root_hash : HashBytes :: ZERO ,
450
+ zerostate_file_hash : HashBytes :: ZERO ,
451
+ version : 0 ,
452
+ format : WorkchainFormat :: Basic ( WorkchainFormatBasic {
453
+ vm_version : 0 ,
454
+ vm_mode : 0 ,
455
+ } ) ,
456
+ } ) ?;
463
457
params. set :: < ConfigParam12 > ( & workchains) ?;
464
458
}
465
459
@@ -502,106 +496,88 @@ fn make_default_params() -> Result<BlockchainConfigParams> {
502
496
} ] ) ?;
503
497
504
498
// Param 20 (masterchain)
505
- params. set_gas_prices (
506
- true ,
507
- & GasLimitsPrices {
508
- gas_price : 655360000 ,
509
- gas_limit : 1000000 ,
510
- special_gas_limit : 100000000 ,
511
- gas_credit : 10000 ,
512
- block_gas_limit : 11000000 ,
513
- freeze_due_limit : 100000000 ,
514
- delete_due_limit : 1000000000 ,
515
- flat_gas_limit : 1000 ,
516
- flat_gas_price : 10000000 ,
517
- } ,
518
- ) ?;
499
+ params. set_gas_prices ( true , & GasLimitsPrices {
500
+ gas_price : 655360000 ,
501
+ gas_limit : 1000000 ,
502
+ special_gas_limit : 100000000 ,
503
+ gas_credit : 10000 ,
504
+ block_gas_limit : 11000000 ,
505
+ freeze_due_limit : 100000000 ,
506
+ delete_due_limit : 1000000000 ,
507
+ flat_gas_limit : 1000 ,
508
+ flat_gas_price : 10000000 ,
509
+ } ) ?;
519
510
520
511
// Param 21 (basechain)
521
- params. set_gas_prices (
522
- false ,
523
- & GasLimitsPrices {
524
- gas_price : 65536000 ,
525
- gas_limit : 1000000 ,
526
- special_gas_limit : 1000000 ,
527
- gas_credit : 10000 ,
528
- block_gas_limit : 10000000 ,
529
- freeze_due_limit : 100000000 ,
530
- delete_due_limit : 1000000000 ,
531
- flat_gas_limit : 1000 ,
532
- flat_gas_price : 1000000 ,
533
- } ,
534
- ) ?;
512
+ params. set_gas_prices ( false , & GasLimitsPrices {
513
+ gas_price : 65536000 ,
514
+ gas_limit : 1000000 ,
515
+ special_gas_limit : 1000000 ,
516
+ gas_credit : 10000 ,
517
+ block_gas_limit : 10000000 ,
518
+ freeze_due_limit : 100000000 ,
519
+ delete_due_limit : 1000000000 ,
520
+ flat_gas_limit : 1000 ,
521
+ flat_gas_price : 1000000 ,
522
+ } ) ?;
535
523
536
524
// Param 22 (masterchain)
537
- params. set_block_limits (
538
- true ,
539
- & BlockLimits {
540
- bytes : BlockParamLimits {
541
- underload : 131072 ,
542
- soft_limit : 524288 ,
543
- hard_limit : 1048576 ,
544
- } ,
545
- gas : BlockParamLimits {
546
- underload : 900000 ,
547
- soft_limit : 1200000 ,
548
- hard_limit : 2000000 ,
549
- } ,
550
- lt_delta : BlockParamLimits {
551
- underload : 1000 ,
552
- soft_limit : 5000 ,
553
- hard_limit : 10000 ,
554
- } ,
525
+ params. set_block_limits ( true , & BlockLimits {
526
+ bytes : BlockParamLimits {
527
+ underload : 131072 ,
528
+ soft_limit : 524288 ,
529
+ hard_limit : 1048576 ,
530
+ } ,
531
+ gas : BlockParamLimits {
532
+ underload : 900000 ,
533
+ soft_limit : 1200000 ,
534
+ hard_limit : 2000000 ,
555
535
} ,
556
- ) ?;
536
+ lt_delta : BlockParamLimits {
537
+ underload : 1000 ,
538
+ soft_limit : 5000 ,
539
+ hard_limit : 10000 ,
540
+ } ,
541
+ } ) ?;
557
542
558
543
// Param 23 (basechain)
559
- params. set_block_limits (
560
- false ,
561
- & BlockLimits {
562
- bytes : BlockParamLimits {
563
- underload : 131072 ,
564
- soft_limit : 524288 ,
565
- hard_limit : 1048576 ,
566
- } ,
567
- gas : BlockParamLimits {
568
- underload : 900000 ,
569
- soft_limit : 1200000 ,
570
- hard_limit : 2000000 ,
571
- } ,
572
- lt_delta : BlockParamLimits {
573
- underload : 1000 ,
574
- soft_limit : 5000 ,
575
- hard_limit : 10000 ,
576
- } ,
544
+ params. set_block_limits ( false , & BlockLimits {
545
+ bytes : BlockParamLimits {
546
+ underload : 131072 ,
547
+ soft_limit : 524288 ,
548
+ hard_limit : 1048576 ,
549
+ } ,
550
+ gas : BlockParamLimits {
551
+ underload : 900000 ,
552
+ soft_limit : 1200000 ,
553
+ hard_limit : 2000000 ,
554
+ } ,
555
+ lt_delta : BlockParamLimits {
556
+ underload : 1000 ,
557
+ soft_limit : 5000 ,
558
+ hard_limit : 10000 ,
577
559
} ,
578
- ) ?;
560
+ } ) ?;
579
561
580
562
// Param 24 (masterchain)
581
- params. set_msg_forward_prices (
582
- true ,
583
- & MsgForwardPrices {
584
- lump_price : 10000000 ,
585
- bit_price : 655360000 ,
586
- cell_price : 65536000000 ,
587
- ihr_price_factor : 98304 ,
588
- first_frac : 21845 ,
589
- next_frac : 21845 ,
590
- } ,
591
- ) ?;
563
+ params. set_msg_forward_prices ( true , & MsgForwardPrices {
564
+ lump_price : 10000000 ,
565
+ bit_price : 655360000 ,
566
+ cell_price : 65536000000 ,
567
+ ihr_price_factor : 98304 ,
568
+ first_frac : 21845 ,
569
+ next_frac : 21845 ,
570
+ } ) ?;
592
571
593
572
// Param 25 (basechain)
594
- params. set_msg_forward_prices (
595
- false ,
596
- & MsgForwardPrices {
597
- lump_price : 1000000 ,
598
- bit_price : 65536000 ,
599
- cell_price : 6553600000 ,
600
- ihr_price_factor : 98304 ,
601
- first_frac : 21845 ,
602
- next_frac : 21845 ,
603
- } ,
604
- ) ?;
573
+ params. set_msg_forward_prices ( false , & MsgForwardPrices {
574
+ lump_price : 1000000 ,
575
+ bit_price : 65536000 ,
576
+ cell_price : 6553600000 ,
577
+ ihr_price_factor : 98304 ,
578
+ first_frac : 21845 ,
579
+ next_frac : 21845 ,
580
+ } ) ?;
605
581
606
582
// Param 28
607
583
params. set_catchain_config ( & CatchainConfig {
@@ -681,7 +657,7 @@ fn build_elector_code(address: &HashBytes, balance: Tokens) -> Result<Account> {
681
657
let code = Boc :: decode ( ELECTOR_CODE ) ?;
682
658
683
659
let mut data = CellBuilder :: new ( ) ;
684
- data. store_small_uint ( 0 , 3 ) ?; //empty dict, empty dict, empty dict
660
+ data. store_small_uint ( 0 , 3 ) ?; // empty dict, empty dict, empty dict
685
661
data. store_small_uint ( 0 , 4 ) ?; // tokens
686
662
data. store_u32 ( 0 ) ?; // elections id
687
663
data. store_zeros ( 256 ) ?; // elections hash
@@ -743,11 +719,11 @@ fn zero_public_key() -> &'static ed25519::PublicKey {
743
719
}
744
720
745
721
mod serde_account_states {
746
- use super :: * ;
747
-
748
722
use serde:: de:: Deserializer ;
749
723
use serde:: ser:: { SerializeMap , Serializer } ;
750
724
725
+ use super :: * ;
726
+
751
727
pub fn serialize < S > (
752
728
value : & HashMap < HashBytes , OptionalAccount > ,
753
729
serializer : S ,
0 commit comments