mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated submodules, bugfixes
- added new fift/func code for validator complaint creation - bugfixes in validator - updates in tonlib - new versions of rocksdb/abseil - hardfork support
This commit is contained in:
parent
16a4566091
commit
9f008b129f
129 changed files with 8438 additions and 879 deletions
|
@ -62,15 +62,31 @@ variable validators-weight
|
|||
validators-weight 0!
|
||||
|
||||
{ validator-dict @ second } : validator#
|
||||
// val-pubkey weight --
|
||||
{ dup 0<= abort"validator weight must be non-negative"
|
||||
dup 64 ufits not abort"validator weight must fit into 64 bits"
|
||||
64 ufits not abort"validator weight must fit into 64 bits"
|
||||
} : check-val-weight
|
||||
// ( val-pubkey weight -- c )
|
||||
{ dup check-val-weight
|
||||
over Blen 32 <> abort"validator public key must be 32 bytes long"
|
||||
tuck <b x{538e81278a} s, rot B, swap 64 u, b> <s
|
||||
validator-dict 2@ dup 1+ 3 -roll swap
|
||||
<b x{538e81278a} s, rot B, swap 64 u, b>
|
||||
} : serialize-validator
|
||||
// ( val-pubkey adnl weight -- c )
|
||||
{ dup check-val-weight
|
||||
over 256 ufits not abort"adnl address must fit into 256 bits"
|
||||
rot dup Blen 32 <> abort"validator public key must be 32 bytes long"
|
||||
<b x{738e81278a} s, swap B, swap 64 u, swap 256 u, b>
|
||||
} : serialize-adnl-validator
|
||||
// ( weight val-cell -- )
|
||||
{ swap validators-weight +!
|
||||
<s validator-dict 2@ dup 1+ 3 -roll swap
|
||||
16 udict!+ 0= abort"cannot add validator"
|
||||
swap validator-dict 2! validators-weight +!
|
||||
} : add-validator
|
||||
swap validator-dict 2!
|
||||
} : register-validator
|
||||
// val-pubkey weight --
|
||||
{ tuck serialize-validator register-validator } : add-validator
|
||||
// val-pubkey adnl-addr weight --
|
||||
{ -rot 2 pick serialize-adnl-validator register-validator
|
||||
} : add-adnl-validator
|
||||
// since-ut until-ut main-val-cnt-or-0 --
|
||||
{ ?dup 0= { validator# } if
|
||||
validator# 0= abort"no initial validators defined"
|
||||
|
@ -230,21 +246,24 @@ variable special-dict
|
|||
} : create-wallet1
|
||||
|
||||
// D x t -- D'
|
||||
{ <b rot Gram, swap rot 16 b>idict! not abort"cannot add value"
|
||||
{ <b rot Gram, swap rot 32 b>idict! not abort"cannot add value"
|
||||
} : rdict-entry
|
||||
{ 86400 * } : days*
|
||||
// balance -- dict
|
||||
{ dictnew
|
||||
over -32768 rdict-entry
|
||||
over 3/4 */ 92 rdict-entry
|
||||
over 1/2 */ 183 rdict-entry
|
||||
swap 1/4 */ 366 rdict-entry
|
||||
0 548 rdict-entry
|
||||
over 31 -1<< rdict-entry
|
||||
over 3/4 */ 91 days* rdict-entry
|
||||
over 1/2 */ 183 days* rdict-entry
|
||||
swap 1/4 */ 365 days* rdict-entry
|
||||
0 548 days* rdict-entry
|
||||
} : make-rdict
|
||||
|
||||
variable wallet2-start-at wallet2-start-at 0!
|
||||
now 86400 / 1+ 86400 * wallet2-start-at !
|
||||
// pubkey amount --
|
||||
{ over ."Key " pubkey>$ type ." -> "
|
||||
RWCode2 // code
|
||||
<b 1 32 u, 3 pick 256 u, 3 roll make-rdict dict, b> // data
|
||||
<b 1 32 u, 3 pick 256 u, 3 roll wallet2-start-at @ 32 u, make-rdict dict, b> // data
|
||||
empty_cell // libs
|
||||
3 roll // balance
|
||||
0 // split_depth
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue