Skip to content

Commit

Permalink
Merge branch 'main' into chore/remove-hello-world
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Oct 10, 2023
2 parents 65ab367 + 7f048c4 commit 40127a2
Show file tree
Hide file tree
Showing 144 changed files with 3,893 additions and 12,773 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ jobs:
pip install tomte[tox]==0.2.13
pip install --user --upgrade setuptools
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
unzip protoc-3.19.4-linux-x86_64.zip -d protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# install IPFS
sudo apt-get install -y wget
Expand Down Expand Up @@ -204,8 +204,8 @@ jobs:
pip install --user --upgrade setuptools
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
unzip protoc-3.19.4-linux-x86_64.zip -d protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# install IPFS
Expand Down Expand Up @@ -258,8 +258,8 @@ jobs:
brew install gcc
# brew install protobuf
# brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/72457f0166d5619a83f508f2345b22d0617b5021/Formula/protobuf.rb
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-osx-x86_64.zip
unzip protoc-3.19.4-osx-x86_64.zip -d protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-osx-x86_64.zip
unzip protoc-24.3-osx-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
brew tap yoheimuta/protolint
brew install protolint
Expand Down Expand Up @@ -302,14 +302,14 @@ jobs:
python -m pip install -U pip
echo "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
choco install wget -y
choco install protoc --version 3.19.4
choco install protoc --version 24.3
choco install mingw -y
choco install make -y
# to check make was installed
make --version
pip install tomte[tox]==0.2.13
# wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win64.zip
# unzip protoc-3.19.4-win64.zip -d protoc
# wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-win64.zip
# unzip protoc-24.3-win64.zip -d protoc
# sudo mv protoc/bin/protoc /usr/local/bin/protoc
# TODO: install protolint
Expand Down Expand Up @@ -386,8 +386,8 @@ jobs:
pip install --user --upgrade setuptools
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
unzip protoc-3.19.4-linux-x86_64.zip -d protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# install IPFS
Expand Down
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,16 @@ packages/valory/protocols/contract_api
packages/valory/protocols/http
packages/valory/protocols/ledger_api

autonomy/data/contracts/registries_manager
autonomy/data/contracts/component_registry
autonomy/data/contracts/service_registry
autonomy/data/contracts/agent_registry
autonomy/data/contracts/component_registry
autonomy/data/contracts/erc20
autonomy/data/contracts/gnosis_safe
autonomy/data/contracts/gnosis_safe_proxy_factory
autonomy/data/contracts/multisend
autonomy/data/contracts/registries_manager
autonomy/data/contracts/service_manager
autonomy/data/contracts/service_registry
autonomy/data/contracts/service_registry_token_utility

.vscode/

Expand All @@ -419,4 +424,5 @@ leak_report
temp/

logs.db
benchmarks.html
agent/
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ignore-patterns=.*_pb2.py,contract_dispatcher.py,test_abci_messages.py,test_tend
ignore=packages/valory/protocols/abci,packages/valory/connections/abci/gogoproto

[MESSAGES CONTROL]
disable=C0103,R0801,C0301,C0201,C0204,C0209,W1203,C0302,R1735,R1729,W0511
disable=C0103,R0801,C0301,C0201,C0204,C0209,W1203,C0302,R1735,R1729,W0511,E0611

# See here for more options: https://www.codeac.io/documentation/pylint-configuration.html
R1735: use-dict-literal
Expand All @@ -16,6 +16,7 @@ C0209: consider-using-f-string
C0301: http://pylint-messages.wikidot.com/messages:c0301 > Line too long
C0302: http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module
R0801: similar lines
E0611: no-name-in-module

[IMPORTS]
ignored-modules=pandas,numpy,aea_cli_ipfs,compose,multidict
Expand Down
5 changes: 4 additions & 1 deletion .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,7 @@ selection_key
0.10.10.post1
unbond
chiado
0.12.1.post1
0.12.1.post1
0.12.1.post2
0.12.1.post3
0.12.1.post4
38 changes: 38 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
# Release History - `open-autonomy`


# 0.13.0 (2023-09-27)

Autonomy:
- Replaces `open-aea-web3` with `web3py<7,>=6.0.0`
- Bumps `protobuf<5.0.0,>=4.21.6`
- Fixes `protobuf` incompatibility issue when importing hardware wallet plugin
- Refactors autonomy and agent images to
- Include install and build scripts in the base image
- Remove unwanted layers
- Remove unwanted data files

Packages:
- Generates protocols using the latest compatible `protobuf` compiler
- Compiles the tendermint connection protocol buffers using the latest compatible `protobuf` compiler

Chores:
- Bumps `protobuf` compiler to `24.3`

# 0.12.1.post4 (2023-09-25)

Autonomy:

- Update the reuse multisig transaction builder to account for services with only one operator

# 0.12.1.post3 (2023-09-21)

Autonomy:

- Pins `jsonschema<=4.19.0,>=4.16.0`

# 0.12.1.post2 (2023-09-20)

Autonomy:

- Adds missing contract packages to the `eject-contracts` make target
- Adds check to make sure service is in `pre-registration` before updating the service hash
- Adds check to make sure all required environment variables are present for on-chain interactions

# 0.12.1.post1 (2023-09-14)

Autonomy:
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ install: clean

.PHONY: eject-contracts
eject-contracts:
@for contract in registries_manager service_manager component_registry agent_registry service_registry ; do \
@for contract in component_registry agent_registry registries_manager service_manager service_registry gnosis_safe gnosis_safe_proxy_factory service_registry_token_utility multisend erc20 ; do \
echo Updating $$contract contract; \
rm -rf autonomy/data/contracts/$$contract ; \
cp -r packages/valory/contracts/$$contract autonomy/data/contracts/$$contract ; \
Expand Down Expand Up @@ -235,3 +235,19 @@ fix-abci-app-specs:

release-images:
skaffold build -p release --cache-artifacts=false && skaffold build -p release-latest


# Usage: INCLUDE=PATH_TO_PROTOC_INCLUDE_DIRECTORY make build-proto
.PHONY: build-proto
build-proto:
@protoc -I $$INCLUDE \
--proto_path=packages/valory/connections/abci/protos/ \
--python_out=packages/valory/connections/abci/ \
packages/valory/connections/abci/protos/gogoproto/gogo.proto \
packages/valory/connections/abci/protos/tendermint/crypto/proof.proto \
packages/valory/connections/abci/protos/tendermint/crypto/keys.proto \
packages/valory/connections/abci/protos/tendermint/abci/types.proto \
packages/valory/connections/abci/protos/tendermint/types/types.proto \
packages/valory/connections/abci/protos/tendermint/types/validator.proto \
packages/valory/connections/abci/protos/tendermint/types/params.proto \
packages/valory/connections/abci/protos/tendermint/version/types.proto
20 changes: 9 additions & 11 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ name = "pypi"
aiohttp = "<3.8,>=3.7.4"
docker = "==6.1.2"
Flask = "==2.0.2"
open-aea = {version = "==1.39.0", extras = ["all"]}
open-aea-ledger-ethereum = "==1.39.0"
open-aea-ledger-ethereum-hwi = "==1.39.0"
open-aea-cli-ipfs = "==1.39.0"
open-aea = {version = "==1.40.0", extras = ["all"]}
open-aea-ledger-ethereum = "==1.40.0"
open-aea-ledger-ethereum-hwi = "==1.40.0"
open-aea-cli-ipfs = "==1.40.0"
ipfshttpclient = "==0.8.0a2"
Werkzeug= "==2.0.3"
watchdog = ">=2.1.6"
Expand All @@ -23,7 +23,7 @@ valory-docker-compose = "==1.29.3"
aiohttp = "<3.8,>=3.7.4"
asn1crypto = "<1.5.0,>=1.4.0"
ecdsa = ">=0.15"
open-aea-web3 = "==6.0.1"
web3 = "<7,>=6.0.0"
certifi = "*"
multidict = "*"
eth_typing ="*"
Expand All @@ -32,16 +32,13 @@ typing_extensions = ">=3.10.0.2"
hexbytes = "*"
packaging = "*"
pytest-asyncio = "*"
open-aea-ledger-cosmos = "==1.39.0"
open-aea-ledger-cosmos = "==1.40.0"
# we pin this as the range specified in open-aea-ledger-cosmos is wide
open-aea-cosmpy = "==0.6.5"
open-aea-cosmpy = "==0.6.6"
grpcio = "==1.53.0"
hypothesis = "==6.21.6"
# latest supported for Python 3.7
numpy = ">=1.21.6"
pandas = "==1.5.3"
pandas-stubs = "==1.2.0.62"
protobuf = "<=3.20.1,>=3.19"
protobuf = "<5.0.0,>=4.21.6"
pytz = "==2022.2.1"
py-ecc = "==6.0.0"
python-dotenv = ">=0.14.0,<0.18.0"
Expand All @@ -53,6 +50,7 @@ toml = "==0.10.2"
eth-utils = "==2.2.0"
eth-abi = "==4.0.0"
pycryptodome = "==3.18.0"
jsonschema = "<=4.19.0,>=4.16.0"

[requires]
python_version = "3.10"
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The following table shows which versions of `open-autonomy` are currently being

| Version | Supported |
| --------- | ------------------ |
| `0.12.1.post1` | :white_check_mark: |
| `< 0.12.x` | :x: |
| `0.13.0` | :white_check_mark: |
| `< 0.13.x` | :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion autonomy/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__title__ = "open-autonomy"
__description__ = "A framework for the creation of autonomous agent services."
__url__ = "https://github.com/valory-xyz/open-autonomy.git"
__version__ = "0.12.1.post1"
__version__ = "0.13.0"
__author__ = "Valory AG"
__license__ = "Apache-2.0"
__copyright__ = "2021-2022 Valory AG"
25 changes: 17 additions & 8 deletions autonomy/analyse/abci/app_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
ABCI_APP_CLASS_POST_FIX = "AbciApp"

EVENT_PATTERN = re.compile(r"Event\.(\w+)", re.DOTALL)
ROUND_TIMEOUT_EVENTS = {"ROUND_TIMEOUT"}


def validate_fsm_spec(data: Dict) -> None:
Expand Down Expand Up @@ -454,25 +455,33 @@ def check_unreferenced_events(abci_app_cls: Any) -> List[str]:
"""

error_strings = []
timeout_events = {k.name for k in abci_app_cls.event_to_timeout.keys()}
abci_app_timeout_events = {k.name for k in abci_app_cls.event_to_timeout.keys()}

for round_cls, round_transitions in abci_app_cls.transition_function.items():
trf_events = {
str(e).rsplit(".", 1)[1] for e in round_transitions
} - timeout_events
round_transition_events = set(map(lambda x: x.name, round_transitions))
referenced_events = set()

for base in filter(
lambda x: x.__class__.__module__ != "builtins",
inspect.getmro(round_cls),
):
src = textwrap.dedent(inspect.getsource(base))
referenced_events.update(EVENT_PATTERN.findall(src))

if trf_events.symmetric_difference(referenced_events):
# Referenced in the the class definition, missing from transition func
missing_from_transition_func = referenced_events - round_transition_events
if len(missing_from_transition_func) > 0:
error_strings.append(
f"Events {missing_from_transition_func} are present in the `{round_cls.__name__}` "
f"but missing from transition function"
)

# Filter timeout events using referenced events since we don't explicitly return the timeout events
timeout_events = round_transition_events - referenced_events
missing_timeout_events = timeout_events - abci_app_timeout_events
if len(missing_timeout_events) > 0:
error_strings.append(
f" - {round_cls.__name__}: transition function events {trf_events} "
f"do not match referenced events {referenced_events}."
f"Events {missing_timeout_events} are defined in the round transitions of `{round_cls.__name__}` "
f"but not in `event_to_timeout`"
)

return error_strings
Loading

0 comments on commit 40127a2

Please sign in to comment.