diff --git a/packages/valory/agents/mech/aea-config.yaml b/packages/valory/agents/mech/aea-config.yaml index 46f1c9f7..772493ec 100644 --- a/packages/valory/agents/mech/aea-config.yaml +++ b/packages/valory/agents/mech/aea-config.yaml @@ -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 diff --git a/packages/valory/services/mech/service.yaml b/packages/valory/services/mech/service.yaml index a00d2edb..d80450e7 100644 --- a/packages/valory/services/mech/service.yaml +++ b/packages/valory/services/mech/service.yaml @@ -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: @@ -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: @@ -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: @@ -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 diff --git a/packages/valory/skills/contract_subscription/skill.yaml b/packages/valory/skills/contract_subscription/skill.yaml index 5d729041..f95ab2cf 100644 --- a/packages/valory/skills/contract_subscription/skill.yaml +++ b/packages/valory/skills/contract_subscription/skill.yaml @@ -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: diff --git a/packages/valory/skills/mech_abci/behaviours.py b/packages/valory/skills/mech_abci/behaviours.py index 41895897..9bc9b459 100644 --- a/packages/valory/skills/mech_abci/behaviours.py +++ b/packages/valory/skills/mech_abci/behaviours.py @@ -57,4 +57,4 @@ class MechConsensusBehaviour(AbstractRoundBehaviour): *TransactionSettlementRoundBehaviour.behaviours, *TerminationAbciBehaviours.behaviours, } - background_behaviour_cls = BackgroundBehaviour + background_behaviours_cls = {BackgroundBehaviour} diff --git a/packages/valory/skills/mech_abci/composition.py b/packages/valory/skills/mech_abci/composition.py index bf21245f..420aef98 100644 --- a/packages/valory/skills/mech_abci/composition.py +++ b/packages/valory/skills/mech_abci/composition.py @@ -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 @@ -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, @@ -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) diff --git a/packages/valory/skills/mech_abci/skill.yaml b/packages/valory/skills/mech_abci/skill.yaml index a86965fc..5dca97d0 100644 --- a/packages/valory/skills/mech_abci/skill.yaml +++ b/packages/valory/skills/mech_abci/skill.yaml @@ -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: diff --git a/packages/valory/skills/task_execution/skill.yaml b/packages/valory/skills/task_execution/skill.yaml index 6b466aa5..4c040f78 100644 --- a/packages/valory/skills/task_execution/skill.yaml +++ b/packages/valory/skills/task_execution/skill.yaml @@ -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: diff --git a/packages/valory/skills/task_submission_abci/skill.yaml b/packages/valory/skills/task_submission_abci/skill.yaml index 91ed3086..cf2e33ba 100644 --- a/packages/valory/skills/task_submission_abci/skill.yaml +++ b/packages/valory/skills/task_submission_abci/skill.yaml @@ -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: {}