Skip to content

Commit

Permalink
feat(blockdata): completed constancies
Browse files Browse the repository at this point in the history
  • Loading branch information
amkCha committed Dec 5, 2024
1 parent 3fd3913 commit ae0ea81
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blockdata/columns.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(FIRST_BLOCK_NUMBER :i48)
(REL_BLOCK :i8)
(REL_TX_NUM_MAX :i10)
(DATA_HIGH :i128)
(DATA_HI :i128)
(DATA_LO :i128)
(ARG_1_HI :i128)
(ARG_1_LO :i128)
Expand Down
20 changes: 20 additions & 0 deletions blockdata/constraints.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,26 @@
(eq! CT_MAX (ct-max-sum))
(eq! INST (inst-sum))))

;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; 2.4 Contancies ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;

(defconstraint counter-constancies ()
(begin (counter-constancy CT DATA_HI)
(counter-constancy CT DATA_LO)
(counter-constancy CT COINBASE_HI)
(counter-constancy CT COINBASE_LO)
(counter-constancy CT REL_TX_NUM_MAX)
(counter-constancy CT BLOCK_GAS_LIMIT)
(counter-constancy CT (wght-sum))))

(defconstraint first-block-number-is-conflation-constant ()
(if-not-zero IOMF
(if-not-zero (shift IOMF 1)
(eq! (shift FIRST_BLOCK_NUMBER 1) FIRST_BLOCK_NUMBER))))

;; TODO: define the others

;; (defconstraint first-row (:domain {0})
Expand Down

0 comments on commit ae0ea81

Please sign in to comment.