Skip to content

Commit

Permalink
updated by contest
Browse files Browse the repository at this point in the history
  • Loading branch information
spikeekips committed Oct 31, 2019
1 parent 3854468 commit a3a578d
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Failure Nodes Over Blocking Number At INIT Stage
:caption: `failure-voting-init-over-blocking-number.yml <https://github.com/spikeekips/mitum-doc/raw/proto2/readthedocs/docs/contest/config/failure-voting-init-over-blocking-number.yml>`_
:language: yaml
:linenos:
:emphasize-lines: 31-32,74
:emphasize-lines: 30-32,75

.. code-block:: sh
:linenos:
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/docs/contest/case-voting-failure-proposing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Failure Of Proposing
:caption: `failure-voting-init-over-blocking-number.yml <https://github.com/spikeekips/mitum-doc/raw/proto2/readthedocs/docs/contest/config/failure-proposing.yml>`_
:language: yaml
:linenos:
:emphasize-lines: 9,17-18,36-37
:emphasize-lines: 9,21-23,40-41

.. code-block:: sh
:linenos:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Failure Nodes Under Blocking Number At INIT Stage
:caption: `failure-voting-init-under-blocking-number.yml <https://github.com/spikeekips/mitum-doc/raw/proto2/readthedocs/docs/contest/config/failure-voting-init-under-blocking-number.yml>`_
:language: yaml
:linenos:
:emphasize-lines: 31-32,100
:emphasize-lines: 30-32,100

.. code-block:: sh
:linenos:
Expand Down
51 changes: 24 additions & 27 deletions readthedocs/docs/contest/config/custom-policy.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
global:
policy:
threshold: 67
interval_broadcast_init_ballot_in_join: 5s
timeout_wait_vote_result_in_join: 6s
timeout_wait_ballot: 6s
threshold: 67
interval_broadcast_init_ballot_in_join: 5s
timeout_wait_vote_result_in_join: 6s
timeout_wait_ballot: 6s

condition:
all:
node_state:
# {
# "level": "info",
# "node": "n0",
# "current_state": "booting",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="booting" AND new_state="joining"
# {
# "level": "info",
# "node": "n0",
# "current_state": "joining",
# "new_state": "consensus",
# "m": "state changed"
# }
- current_state="joining" AND new_state="consensus"


new_block:
- m="new block created" and block.height>=12 and block.round=0
conditions:
all:
# {
# "level": "info",
# "node": "n0",
# "current_state": "booting",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="booting" AND new_state="joining"
# {
# "level": "info",
# "node": "n0",
# "current_state": "joining",
# "new_state": "consensus",
# "m": "state changed"
# }
- current_state="joining" AND new_state="consensus"

- m="new block created" and block.height>=12 and block.round=0
80 changes: 42 additions & 38 deletions readthedocs/docs/contest/config/failure-proposing.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
global:
modules:
suffrage:
name: ConditionSuffrage
conditions:
stop:
condition: suffrage.height=13
action: fixed-proposer
value: n3
modules:
suffrage:
name: ConditionSuffrage
conditions:
- condition: suffrage.height=13
actions:
- action: fixed-proposer
value: n3
proposal_maker:
name: ConditionProposalMaker
delay: 1s
conditions:
nodes:
n3:
modules:
proposal_maker:
name: ConditionProposalMaker
conditions:
stop:
condition: proposal.height=13 AND proposal.round in (0)
action: empty-proposal

condition:
all:
base_state:
- current_state="booting" AND new_state="joining"
- current_state="joining" AND new_state="consensus"

move_next_round:
# {
# "level": "debug",
# "module": "proposal-timeout",
# "count": 0,
# "limit": 0,
# "callbacks": 1,
# "elapsed": 15.210288,
# "m": "callback executed"
# }
- module="proposal-timeout" AND m LIKE "callback executed" AND elapsed < 50
- m="check majority" AND height=13 AND round=1 AND stage="INIT" AND is_finished=true

new_block:
- m="new block created" AND block.height=13 AND block.round=1
n3:
modules:
proposal_maker:
name: ConditionProposalMaker
delay: 1s
conditions:
- condition: proposal.height=13 AND proposal.round in (0)
actions:
- action: empty-proposal
conditions:
all:
- current_state="booting" AND new_state="joining"
- current_state="joining" AND new_state="consensus"
# move to next round
# {
# "level": "debug",
# "module": "proposal-timeout",
# "count": 0,
# "limit": 0,
# "callbacks": 1,
# "elapsed": 15.210288,
# "m": "callback executed"
# }
- module="proposal-timeout" AND m LIKE "callback executed" AND elapsed < 50
- m="check majority" AND height=13 AND round=1 AND stage="INIT" AND is_finished=true
# new block
- m="new block created" AND block.height=13 AND block.round=1
Original file line number Diff line number Diff line change
@@ -1,83 +1,84 @@
nodes:
n2:
modules:
ballot_maker:
name: ConditionBallotMaker
conditions:
stop:
# {
# "ballot": {
# "current_proposal": "sl:7e8sQiEQReVtoe9HcQBfAgNr4V1ZDgx18jpEstuAiA6f",
# "current_round": 0,
# "last_block": "bk:2Xii7H6ykkD58euEHe8DEhAZJPxT3owUEj7EHY9e5HGH",
# "last_round": 0,
# "next_block": "bk:8pyPKQdX78sAe83zq8EoR6NgvfCqRqKNHduBG3xZLHNJ",
# "next_height": 13,
# "stage": "INIT"
# },
# "block": {
# "height": 11,
# "proposal": "sl:8QiEL44ptpYWVgRUxRr9D3KiBYknetonqeJCjHAPD8js",
# "round": 0
# },
# "node": "n3",
# "previousBlock": {
# "height": 10,
# "proposal": "pp:JC5VCGQWagkpSCAXxMa8737LCjkh1gQNkL91jGPmwCjo",
# "round": 11
# },
# "state": "consensus"
# }
condition: ballot.next_height=13 AND ballot.stage in ("INIT")
action: empty-ballot
n3:
modules:
ballot_maker:
name: ConditionBallotMaker
conditions:
stop:
condition: ballot.next_height=13 AND ballot.stage in ("INIT")
action: empty-ballot
n2:
modules:
ballot_maker:
name: ConditionBallotMaker
conditions:
# {
# "ballot": {
# "current_proposal": "sl:7e8sQiEQReVtoe9HcQBfAgNr4V1ZDgx18jpEstuAiA6f",
# "current_round": 0,
# "last_block": "bk:2Xii7H6ykkD58euEHe8DEhAZJPxT3owUEj7EHY9e5HGH",
# "last_round": 0,
# "next_block": "bk:8pyPKQdX78sAe83zq8EoR6NgvfCqRqKNHduBG3xZLHNJ",
# "next_height": 13,
# "stage": "INIT"
# },
# "block": {
# "height": 11,
# "proposal": "sl:8QiEL44ptpYWVgRUxRr9D3KiBYknetonqeJCjHAPD8js",
# "round": 0
# },
# "node": "n3",
# "previousBlock": {
# "height": 10,
# "proposal": "pp:JC5VCGQWagkpSCAXxMa8737LCjkh1gQNkL91jGPmwCjo",
# "round": 11
# },
# "state": "consensus"
# }
- condition: ballot.next_height=13 AND ballot.stage in ("INIT")
actions:
- action: empty-ballot
n3:
modules:
ballot_maker:
name: ConditionBallotMaker
conditions:
- condition: ballot.next_height=13 AND ballot.stage in ("INIT")
actions:
- action: empty-ballot

conditions:
all:
# base state
# {
# "level": "info",
# "current_state": "booting",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="booting" AND new_state="joining"

condition:
all:
base_state:
# {
# "level": "info",
# "current_state": "booting",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="booting" AND new_state="joining"
# {
# "level": "info",
# "current_state": "joining",
# "new_state": "consensus",
# "m": "state changed"
# }
- current_state="joining" AND new_state="consensus"

check_majority_accept:
# {
# "level": "debug",
# "height": "12",
# "round": 0,
# "total": 4,
# "threshold": 3,
# "stage": "ACCEPT",
# "set": [
# 3
# ],
# "is_finished": true,
# "m": "check majority"
# }
- m="check majority" AND height=12 AND round=0 AND stage="ACCEPT" AND is_finished=true

after_failure_state:
# {
# "level": "info",
# "current_state": "consensus",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="consensus" AND new_state="joining"
# {
# "level": "info",
# "current_state": "joining",
# "new_state": "consensus",
# "m": "state changed"
# }
- current_state="joining" AND new_state="consensus"

# check_majority_accept
# {
# "level": "debug",
# "height": "12",
# "round": 0,
# "total": 4,
# "threshold": 3,
# "stage": "ACCEPT",
# "set": [
# 3
# ],
# "is_finished": true,
# "m": "check majority"
# }
- m="check majority" AND height=12 AND round=0 AND stage="ACCEPT" AND is_finished=true

# after_failure_state
# {
# "level": "info",
# "current_state": "consensus",
# "new_state": "joining",
# "m": "state changed"
# }
- current_state="consensus" AND new_state="joining"

0 comments on commit a3a578d

Please sign in to comment.