Skip to content

Commit

Permalink
fix: breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvilelaf committed Sep 28, 2023
1 parent 4ab56c6 commit 42603d7
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 9 deletions.
5 changes: 5 additions & 0 deletions packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ models:
all_participants: ${list:["0x10E867Ac2Fb0Aa156ca81eF440a5cdf373bE1AaC"]}
safe_contract_address: ${str:0x5e1D1eb61E1164D5a50b28C575dA73A29595dFf7}
consensus_threshold: ${int:null}
use_slashing: ${bool:false}
slash_cooldown_hours: ${int:3}
slash_threshold_amount: ${int:10000000000000000}
light_slash_unit_amount: ${int:5000000000000000}
serious_slash_unit_amount: ${int:8000000000000000}
---
public_id: valory/task_execution:0.1.0
type: skill
Expand Down
20 changes: 20 additions & 0 deletions packages/valory/services/mech/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ type: skill
use_termination: ${USE_TERMINATION:bool:false}
agent_mech_contract_address: ${AGENT_MECH_CONTRACT_ADDRESS:str:0xFf82123dFB52ab75C417195c5fDB87630145ae81}
reset_period_count: ${RESET_PERIOD_COUNT:int:1000}
use_slashing: ${USE_SLASHING:bool:false}
slash_cooldown_hours: ${SLASH_COOLDOWN_HOURS:int:3}
slash_threshold_amount: ${SLASH_THRESHOLD_AMOUNT:int:10000000000000000}
light_slash_unit_amount: ${LIGHT_SLASH_UNIT_AMOUNT:int:5000000000000000}
serious_slash_unit_amount: ${SERIOUS_SLASH_UNIT_AMOUNT:int:8000000000000000}
1:
models:
params:
Expand All @@ -64,6 +69,11 @@ type: skill
use_termination: ${USE_TERMINATION:bool:false}
agent_mech_contract_address: ${AGENT_MECH_CONTRACT_ADDRESS:str:0xFf82123dFB52ab75C417195c5fDB87630145ae81}
reset_period_count: ${RESET_PERIOD_COUNT:int:1000}
use_slashing: ${USE_SLASHING:bool:false}
slash_cooldown_hours: ${SLASH_COOLDOWN_HOURS:int:3}
slash_threshold_amount: ${SLASH_THRESHOLD_AMOUNT:int:10000000000000000}
light_slash_unit_amount: ${LIGHT_SLASH_UNIT_AMOUNT:int:5000000000000000}
serious_slash_unit_amount: ${SERIOUS_SLASH_UNIT_AMOUNT:int:8000000000000000}
2:
models:
params:
Expand All @@ -83,6 +93,11 @@ type: skill
use_termination: ${USE_TERMINATION:bool:false}
agent_mech_contract_address: ${AGENT_MECH_CONTRACT_ADDRESS:str:0xFf82123dFB52ab75C417195c5fDB87630145ae81}
reset_period_count: ${RESET_PERIOD_COUNT:int:1000}
use_slashing: ${USE_SLASHING:bool:false}
slash_cooldown_hours: ${SLASH_COOLDOWN_HOURS:int:3}
slash_threshold_amount: ${SLASH_THRESHOLD_AMOUNT:int:10000000000000000}
light_slash_unit_amount: ${LIGHT_SLASH_UNIT_AMOUNT:int:5000000000000000}
serious_slash_unit_amount: ${SERIOUS_SLASH_UNIT_AMOUNT:int:8000000000000000}
3:
models:
params:
Expand All @@ -102,6 +117,11 @@ type: skill
use_termination: ${USE_TERMINATION:bool:false}
agent_mech_contract_address: ${AGENT_MECH_CONTRACT_ADDRESS:str:0xFf82123dFB52ab75C417195c5fDB87630145ae81}
reset_period_count: ${RESET_PERIOD_COUNT:int:1000}
use_slashing: ${USE_SLASHING:bool:false}
slash_cooldown_hours: ${SLASH_COOLDOWN_HOURS:int:3}
slash_threshold_amount: ${SLASH_THRESHOLD_AMOUNT:int:10000000000000000}
light_slash_unit_amount: ${LIGHT_SLASH_UNIT_AMOUNT:int:5000000000000000}
serious_slash_unit_amount: ${SERIOUS_SLASH_UNIT_AMOUNT:int:8000000000000000}
---
public_id: valory/task_execution:0.1.0
type: skill
Expand Down
5 changes: 5 additions & 0 deletions packages/valory/skills/contract_subscription/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ models:
params:
args:
use_polling: false
use_slashing: false
slash_cooldown_hours: 3
slash_threshold_amount: 10000000000000000
light_slash_unit_amount: 5000000000000000
serious_slash_unit_amount: 8000000000000000
class_name: Params
dependencies:
open-aea-web3:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/mech_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ class MechConsensusBehaviour(AbstractRoundBehaviour):
*TransactionSettlementRoundBehaviour.behaviours,
*TerminationAbciBehaviours.behaviours,
}
background_behaviour_cls = BackgroundBehaviour
background_behaviours_cls = {BackgroundBehaviour}
21 changes: 13 additions & 8 deletions packages/valory/skills/mech_abci/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
AbciAppTransitionMapping,
chain,
)
from packages.valory.skills.termination_abci.rounds import BackgroundRound
from packages.valory.skills.termination_abci.rounds import Event as TerminationEvent
from packages.valory.skills.termination_abci.rounds import TerminationAbciApp
from packages.valory.skills.abstract_round_abci.base import BackgroundAppConfig
from packages.valory.skills.termination_abci.rounds import (
BackgroundRound,
Event,
TerminationAbciApp,
)


# Here we define how the transition between the FSMs should happen
Expand All @@ -45,6 +48,12 @@
ResetAndPauseAbci.FinishedResetAndPauseErrorRound: RegistrationAbci.RegistrationRound,
}

termination_config = BackgroundAppConfig(
round_cls=BackgroundRound,
start_event=Event.TERMINATE,
abci_app=TerminationAbciApp,
)

MechAbciApp = chain(
(
RegistrationAbci.AgentRegistrationAbciApp,
Expand All @@ -53,8 +62,4 @@
TransactionSubmissionAbciApp.TransactionSubmissionAbciApp,
),
abci_app_transition_mapping,
).add_termination(
background_round_cls=BackgroundRound,
termination_event=TerminationEvent.TERMINATE,
termination_abci_app=TerminationAbciApp,
)
).add_background_app(termination_config)
5 changes: 5 additions & 0 deletions packages/valory/skills/mech_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ models:
use_termination: false
validate_timeout: 1205
task_wait_timeout: 15.0
use_slashing: false
slash_cooldown_hours: 3
slash_threshold_amount: 10000000000000000
light_slash_unit_amount: 5000000000000000
serious_slash_unit_amount: 8000000000000000
class_name: Params
randomness_api:
args:
Expand Down
5 changes: 5 additions & 0 deletions packages/valory/skills/task_execution/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ models:
polling_interval: 30.0
agent_index: 0
num_agents: 4
use_slashing: false
slash_cooldown_hours: 3
slash_threshold_amount: 10000000000000000
light_slash_unit_amount: 5000000000000000
serious_slash_unit_amount: 8000000000000000
class_name: Params
dependencies:
openai:
Expand Down
5 changes: 5 additions & 0 deletions packages/valory/skills/task_submission_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ models:
task_wait_timeout: 15
use_termination: false
validate_timeout: 1205
use_slashing: false
slash_cooldown_hours: 3
slash_threshold_amount: 10000000000000000
light_slash_unit_amount: 5000000000000000
serious_slash_unit_amount: 8000000000000000
class_name: Params
requests:
args: {}
Expand Down

0 comments on commit 42603d7

Please sign in to comment.