Skip to content

Commit

Permalink
Merge pull request #243 from valory-xyz/fix/checkpoint
Browse files Browse the repository at this point in the history
Fix/checkpoint
  • Loading branch information
dvilelaf authored Dec 3, 2024
2 parents a9c508c + 3eff941 commit 660e37c
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 37 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit:
2. Fetch the IEKit.

```bash
autonomy fetch valory/impact_evaluator:0.1.0:bafybeicvqay4csxxxxacwrayxqenv3d4r2rz3xuyfxcu6ojyamx732nos4 --service
autonomy fetch valory/impact_evaluator:0.1.0:bafybeiatlrpepgcyxmiwlcfmudo4ea3dpytgo4ivkegqopugi2fbgwypsu --service
```

3. Build the Docker image of the service agents
Expand Down
20 changes: 10 additions & 10 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
"connection/valory/twitter/0.1.0": "bafybeiankzrpgovfe34wbxxwzmrg6lbdpe2uegcu4ujtswuopr3b7fsqdq",
"connection/valory/openai/0.1.0": "bafybeiaryip2lbiluf7vjsdq6r5qiqdesmhqevrzekfrxpugfypqja6gae",
"connection/valory/farcaster/0.1.0": "bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi",
"skill/valory/dynamic_nft_abci/0.1.0": "bafybeihmvdyi2vqvglymzvzr3ewcb2u2k2nmv5vgxoywc5aevbu5bfwzc4",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeids63rj6ktfmc6nwmjcuo5myft4fw757ea4n4wes5hpf3foz37ozm",
"skill/valory/dynamic_nft_abci/0.1.0": "bafybeibjo44mdovoaimfsagxxrvmj2nh7w22wig3xq7xx4x3ksrj3wi3pm",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeibowidqjmxzgvi2s3yocrsolkbofao5sjir6boapyja3s27jbkwc4",
"skill/valory/ceramic_read_abci/0.1.0": "bafybeibph35jhtvn6kgytj6mqdz4lpjkvtfqd75qorrt4onv6i2trxfttu",
"skill/valory/ceramic_write_abci/0.1.0": "bafybeihez2zrvvt6cyi5vu3fpomjlbo3v4fzyf4buv7ysxzj4dntr2wy3q",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeib5pmkaetlmwq33y6iyvt3veqc46uql5ewlp4qhqk7v4ibk2guyfa",
"skill/valory/generic_scoring_abci/0.1.0": "bafybeie4bnpfrvnoq33p7f5l2lhdfdo67m4irgygw7ojegobsbuplljese",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeic5n47n3m5e6a62sscfafubmqughrw2mrt5tcoe34pbjnqpi36g5u",
"skill/valory/generic_scoring_abci/0.1.0": "bafybeih3zk4zx4ul3rkl5s4yaqxl5wkl723j23t5ggbzsn2u7t5w5abbsy",
"skill/valory/twitter_write_abci/0.1.0": "bafybeig4dc4cereyshk535pfpparvxiuaimdu4lsm3hnl5li7pxafho6lu",
"skill/valory/llm_abci/0.1.0": "bafybeihpfesi2sjqdcb2j2mqybhz7av7jlvf27ozk32wbwmklkdugycxyq",
"skill/valory/decision_making_abci/0.1.0": "bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a",
"skill/valory/olas_week_abci/0.1.0": "bafybeigysaisyvswbkkzbriloscxcoxntpjkpjhzzh2uhubfiihvmwfteq",
"skill/valory/decision_making_abci/0.1.0": "bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm",
"skill/valory/olas_week_abci/0.1.0": "bafybeibzg3jo5ilrii6f5cgk2htuipjueuyzjj6vfcqlnug4ooforjizni",
"skill/valory/mech_interact_abci/0.1.0": "bafybeib4vn6m2yumwoclh5aatcdt5yxcjc5owxmxy5o7t3nfzormgwkr64",
"skill/valory/farcaster_write_abci/0.1.0": "bafybeibbbfui3g2s63cg5vsvxqpzzdg2uxhd7a4ikwfo6dy7b2klqthvu4",
"skill/valory/farcaster_test_abci/0.1.0": "bafybeiblauv376hvy7dzi232fxf6iq5nxxnhvk2gy6g7kcsj7a4r2bilqa",
"skill/valory/staking_abci/0.1.0": "bafybeifj7abuwvydsfc5fxsqp5fw3nrz7uamnlajkcqx727nmhrjmqblk4",
"agent/valory/impact_evaluator/0.1.0": "bafybeie4c2hbjpbymqvsasxrabwmxyp7o6avcmqt5wtrtepjnpmn45uzym",
"skill/valory/staking_abci/0.1.0": "bafybeicabieii5mlugcq34hk4ylmmti5judectixo4y6kxzolzw7gexgl4",
"agent/valory/impact_evaluator/0.1.0": "bafybeifp66n4kppy52hovt3tc3an7s5bcqbfrbhfpt3spd4sizb6mcofdi",
"agent/valory/farcaster_test/0.1.0": "bafybeig6yilme5s7fvru2b44dtr5xxqz3gf7p56swr7c5hip775l5wally",
"service/valory/impact_evaluator/0.1.0": "bafybeicvqay4csxxxxacwrayxqenv3d4r2rz3xuyfxcu6ojyamx732nos4",
"service/valory/impact_evaluator_local/0.1.0": "bafybeiff476k4z32hkhcvxq4h3ufrcw73ozqtxoekhjiywnmcofpus2ed4"
"service/valory/impact_evaluator/0.1.0": "bafybeiatlrpepgcyxmiwlcfmudo4ea3dpytgo4ivkegqopugi2fbgwypsu",
"service/valory/impact_evaluator_local/0.1.0": "bafybeihy5xsp5muo55glmq4sih2jln7lfkqhokasg6ttunik3zqk2ci5a4"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
14 changes: 7 additions & 7 deletions packages/valory/agents/impact_evaluator/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ protocols:
skills:
- valory/abstract_abci:0.1.0:bafybeif2naoydlrqkdpnig34uejedwgurjwyvmbpcz53tif7pyukfdophq
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/impact_evaluator_abci:0.1.0:bafybeib5pmkaetlmwq33y6iyvt3veqc46uql5ewlp4qhqk7v4ibk2guyfa
- valory/generic_scoring_abci:0.1.0:bafybeie4bnpfrvnoq33p7f5l2lhdfdo67m4irgygw7ojegobsbuplljese
- valory/twitter_scoring_abci:0.1.0:bafybeids63rj6ktfmc6nwmjcuo5myft4fw757ea4n4wes5hpf3foz37ozm
- valory/impact_evaluator_abci:0.1.0:bafybeic5n47n3m5e6a62sscfafubmqughrw2mrt5tcoe34pbjnqpi36g5u
- valory/generic_scoring_abci:0.1.0:bafybeih3zk4zx4ul3rkl5s4yaqxl5wkl723j23t5ggbzsn2u7t5w5abbsy
- valory/twitter_scoring_abci:0.1.0:bafybeibowidqjmxzgvi2s3yocrsolkbofao5sjir6boapyja3s27jbkwc4
- valory/ceramic_read_abci:0.1.0:bafybeibph35jhtvn6kgytj6mqdz4lpjkvtfqd75qorrt4onv6i2trxfttu
- valory/ceramic_write_abci:0.1.0:bafybeihez2zrvvt6cyi5vu3fpomjlbo3v4fzyf4buv7ysxzj4dntr2wy3q
- valory/dynamic_nft_abci:0.1.0:bafybeihmvdyi2vqvglymzvzr3ewcb2u2k2nmv5vgxoywc5aevbu5bfwzc4
- valory/dynamic_nft_abci:0.1.0:bafybeibjo44mdovoaimfsagxxrvmj2nh7w22wig3xq7xx4x3ksrj3wi3pm
- valory/registration_abci:0.1.0:bafybeiagi6e2h7kochmlemy5c5yk6hwn37tfxiqvk2en74jhowsdwlmrny
- valory/reset_pause_abci:0.1.0:bafybeiezfedmmseox3ce5aucxsiszdmvskrwwbtpb2a3vw3sbmc5jt7nri
- valory/termination_abci:0.1.0:bafybeiea67epwwgngp7b3wavs6hpkaxv6etyaps6g6325bchfnf354mibq
- valory/transaction_settlement_abci:0.1.0:bafybeifmgmwdkx4esemxjacjwzqkqymkuklb5nehkwqkx7v335fllgswcq
- valory/twitter_write_abci:0.1.0:bafybeig4dc4cereyshk535pfpparvxiuaimdu4lsm3hnl5li7pxafho6lu
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
- valory/llm_abci:0.1.0:bafybeihpfesi2sjqdcb2j2mqybhz7av7jlvf27ozk32wbwmklkdugycxyq
- valory/olas_week_abci:0.1.0:bafybeigysaisyvswbkkzbriloscxcoxntpjkpjhzzh2uhubfiihvmwfteq
- valory/olas_week_abci:0.1.0:bafybeibzg3jo5ilrii6f5cgk2htuipjueuyzjj6vfcqlnug4ooforjizni
- valory/mech_interact_abci:0.1.0:bafybeib4vn6m2yumwoclh5aatcdt5yxcjc5owxmxy5o7t3nfzormgwkr64
- valory/staking_abci:0.1.0:bafybeifj7abuwvydsfc5fxsqp5fw3nrz7uamnlajkcqx727nmhrjmqblk4
- valory/staking_abci:0.1.0:bafybeicabieii5mlugcq34hk4ylmmti5judectixo4y6kxzolzw7gexgl4
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/impact_evaluator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe
fingerprint_ignore_patterns: []
agent: valory/impact_evaluator:0.1.0:bafybeie4c2hbjpbymqvsasxrabwmxyp7o6avcmqt5wtrtepjnpmn45uzym
agent: valory/impact_evaluator:0.1.0:bafybeifp66n4kppy52hovt3tc3an7s5bcqbfrbhfpt3spd4sizb6mcofdi
number_of_agents: 4
deployment:
agent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe
fingerprint_ignore_patterns: []
agent: valory/impact_evaluator:0.1.0:bafybeie4c2hbjpbymqvsasxrabwmxyp7o6avcmqt5wtrtepjnpmn45uzym
agent: valory/impact_evaluator:0.1.0:bafybeifp66n4kppy52hovt3tc3an7s5bcqbfrbhfpt3spd4sizb6mcofdi
number_of_agents: 1
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/decision_making_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protocols:
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/ceramic_read_abci:0.1.0:bafybeibph35jhtvn6kgytj6mqdz4lpjkvtfqd75qorrt4onv6i2trxfttu
- valory/staking_abci:0.1.0:bafybeifj7abuwvydsfc5fxsqp5fw3nrz7uamnlajkcqx727nmhrjmqblk4
- valory/staking_abci:0.1.0:bafybeicabieii5mlugcq34hk4ylmmti5judectixo4y6kxzolzw7gexgl4
behaviours:
main:
args: {}
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/dynamic_nft_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protocols:
- valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
behaviours:
main:
args: {}
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/generic_scoring_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contracts: []
protocols: []
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
behaviours:
main:
args: {}
Expand Down
12 changes: 6 additions & 6 deletions packages/valory/skills/impact_evaluator_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ protocols: []
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/ceramic_read_abci:0.1.0:bafybeibph35jhtvn6kgytj6mqdz4lpjkvtfqd75qorrt4onv6i2trxfttu
- valory/generic_scoring_abci:0.1.0:bafybeie4bnpfrvnoq33p7f5l2lhdfdo67m4irgygw7ojegobsbuplljese
- valory/twitter_scoring_abci:0.1.0:bafybeids63rj6ktfmc6nwmjcuo5myft4fw757ea4n4wes5hpf3foz37ozm
- valory/generic_scoring_abci:0.1.0:bafybeih3zk4zx4ul3rkl5s4yaqxl5wkl723j23t5ggbzsn2u7t5w5abbsy
- valory/twitter_scoring_abci:0.1.0:bafybeibowidqjmxzgvi2s3yocrsolkbofao5sjir6boapyja3s27jbkwc4
- valory/ceramic_write_abci:0.1.0:bafybeihez2zrvvt6cyi5vu3fpomjlbo3v4fzyf4buv7ysxzj4dntr2wy3q
- valory/dynamic_nft_abci:0.1.0:bafybeihmvdyi2vqvglymzvzr3ewcb2u2k2nmv5vgxoywc5aevbu5bfwzc4
- valory/dynamic_nft_abci:0.1.0:bafybeibjo44mdovoaimfsagxxrvmj2nh7w22wig3xq7xx4x3ksrj3wi3pm
- valory/registration_abci:0.1.0:bafybeiagi6e2h7kochmlemy5c5yk6hwn37tfxiqvk2en74jhowsdwlmrny
- valory/reset_pause_abci:0.1.0:bafybeiezfedmmseox3ce5aucxsiszdmvskrwwbtpb2a3vw3sbmc5jt7nri
- valory/termination_abci:0.1.0:bafybeiea67epwwgngp7b3wavs6hpkaxv6etyaps6g6325bchfnf354mibq
- valory/transaction_settlement_abci:0.1.0:bafybeifmgmwdkx4esemxjacjwzqkqymkuklb5nehkwqkx7v335fllgswcq
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
- valory/llm_abci:0.1.0:bafybeihpfesi2sjqdcb2j2mqybhz7av7jlvf27ozk32wbwmklkdugycxyq
- valory/twitter_write_abci:0.1.0:bafybeig4dc4cereyshk535pfpparvxiuaimdu4lsm3hnl5li7pxafho6lu
- valory/olas_week_abci:0.1.0:bafybeigysaisyvswbkkzbriloscxcoxntpjkpjhzzh2uhubfiihvmwfteq
- valory/olas_week_abci:0.1.0:bafybeibzg3jo5ilrii6f5cgk2htuipjueuyzjj6vfcqlnug4ooforjizni
- valory/mech_interact_abci:0.1.0:bafybeib4vn6m2yumwoclh5aatcdt5yxcjc5owxmxy5o7t3nfzormgwkr64
- valory/staking_abci:0.1.0:bafybeifj7abuwvydsfc5fxsqp5fw3nrz7uamnlajkcqx727nmhrjmqblk4
- valory/staking_abci:0.1.0:bafybeicabieii5mlugcq34hk4ylmmti5judectixo4y6kxzolzw7gexgl4
behaviours:
main:
args: {}
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/olas_week_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protocols:
- valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
behaviours:
main:
args: {}
Expand Down
13 changes: 8 additions & 5 deletions packages/valory/skills/staking_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ def is_checkpoint_callable(self, staking_contract_address) -> Generator[None, No
epoch_end = yield from self.get_epoch_end(staking_contract_address)

if not epoch_end:
self.context.logger.error(f"Could not get the epoch end for contract {staking_contract_address}")
return False

self.context.logger.info(f"Epoch end for contract {staking_contract_address} is {epoch_end.strftime('%Y-%m-%d %H:%M:%S')}")

# If the epoch end is in the past, the epoch has ended and
# no one has called the checkpoint
return epoch_end < self._get_utc_time()
Expand Down Expand Up @@ -356,14 +359,10 @@ def get_checkpoint_hash(self) -> Generator[None, None, Optional[str]]:

for staking_contract_address in self.params.staking_contract_addresses:

# Check if there is some service staked on this contract
# services_staked = yield from self.get_staked_services(staking_contract_address)
# if not services_staked:
# continue

# Check if this checkpoint needs to be called
is_checkpoint_callable = yield from self.is_checkpoint_callable(staking_contract_address)
if not is_checkpoint_callable:
self.context.logger.info(f"Checkpoint is not callable for contract {staking_contract_address}")
continue

# Use the contract api to interact with the staking contract
Expand Down Expand Up @@ -398,6 +397,10 @@ def get_checkpoint_hash(self) -> Generator[None, None, Optional[str]]:
"data": data_bytes,
}
)
self.context.logger.info(f"Added checkpoint call for contract {staking_contract_address}")

if not multi_send_txs:
return None

# Multisend call
contract_api_msg = yield from self.get_contract_api_response(
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/staking_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeie3oujhxxdr5s2lvc6cosbysezqycagw5mbwvxjw24k3dzcbtgg5m
behaviours.py: bafybeibcda7ivugjkmvkvqdfuyuwhxvj6vswubw6ztfzbrqcjrklierp4e
behaviours.py: bafybeihuxzvd2hk27cebcazmudclzdtdr7mjpejqou2q3xbkxlftlso37y
dialogues.py: bafybeifmmpyiwetlcgykczsq4dgwvm7tipdupf2rwcndg5cmtm7jfoxwxm
fsm_specification.yaml: bafybeicjj2blynjtxejcjkr3fmb5mlvfxu4zpymqwurdciqvj5biz37ruu
handlers.py: bafybeiaufft2fwbbjbbc77md6xkq7prnzzi2nkkm2fipapgx54myabmb7y
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/twitter_scoring_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protocols:
- valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i
skills:
- valory/abstract_round_abci:0.1.0:bafybeigjddhk7epta7xpnfvv426xedff5abh4xlkwi6cqgp4vkutgkvydm
- valory/decision_making_abci:0.1.0:bafybeib2pwbdwfqjpzlyrabxs6m63exobfhfxwpvsj62bsdt2l46ha2q7a
- valory/decision_making_abci:0.1.0:bafybeiem7f6g5d72xbtfus52sypg5rykqzf5dzonoxx4s6aonewwmv3jrm
- valory/mech_interact_abci:0.1.0:bafybeib4vn6m2yumwoclh5aatcdt5yxcjc5owxmxy5o7t3nfzormgwkr64
behaviours:
main:
Expand Down

0 comments on commit 660e37c

Please sign in to comment.