Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.10.11 #2021

Merged
merged 26 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3fe352b
feat: add support for skipping the dependency check
angrybayblade Aug 8, 2023
625f4b9
feat: service manager token contract
angrybayblade Aug 8, 2023
69dffa8
feat: service registry L2 contract
angrybayblade Aug 8, 2023
744ea15
fix: service manager ABI
angrybayblade Aug 8, 2023
763d804
feat: add support for service minting on L2 chains
angrybayblade Aug 8, 2023
d6b8d59
chore: hashes
angrybayblade Aug 8, 2023
1e0d0bb
feat: update make target to eject contracts
angrybayblade Aug 8, 2023
5809223
chore: CLI docs
angrybayblade Aug 8, 2023
efaa8d3
chore: api docs
angrybayblade Aug 8, 2023
a21c56c
chore: bump open-autonomy to `v0.10.11`
angrybayblade Aug 8, 2023
823de16
feat: bump open-aea-test-autonomy to `v0.10.11`
angrybayblade Aug 8, 2023
21a103f
chore: release notes
angrybayblade Aug 8, 2023
9708904
chore: lock packages
angrybayblade Aug 8, 2023
f2601d3
feat: merge `service_manager` and `service_manager_token`
angrybayblade Aug 8, 2023
7904f7d
feat: merge `service_registry_l2` and `service_registry`
angrybayblade Aug 8, 2023
de07cc6
fix: remove the need for defining `l2` chains explicitly
angrybayblade Aug 8, 2023
4dd22fa
fix: makefile targets
angrybayblade Aug 8, 2023
6846961
chore: linters
angrybayblade Aug 8, 2023
c378a94
chore: hashes
angrybayblade Aug 8, 2023
83c6b9b
fix: only verify dependency when publishing on ethereum
angrybayblade Aug 8, 2023
ce99611
chore: docs
angrybayblade Aug 8, 2023
e4d8387
fix: API docs
angrybayblade Aug 8, 2023
9ea8a1b
fix: mint tests
angrybayblade Aug 8, 2023
60e3a7e
fix: tx receipt retrieval
angrybayblade Aug 9, 2023
696b641
fix: missing tx receipt handling
angrybayblade Aug 9, 2023
a195eb5
fix: service_registry tests
angrybayblade Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History - `open-autonomy`

# 0.10.11 (2023-08-08)

Autonomy:
- Adds support for minting services on layer 2 chains
- Adds support for skipping dependency checks when minting components

# 0.10.10.post1 (2023-07-28)

Autonomy:
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.10.10.post1` | :white_check_mark: |
| `< 0.10.10.post1` | :x: |
| `0.10.11` | :white_check_mark: |
| `< 0.10.11` | :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.10.10.post1"
__version__ = "0.10.11"
__author__ = "Valory AG"
__license__ = "Apache-2.0"
__copyright__ = "2021-2022 Valory AG"
6 changes: 3 additions & 3 deletions autonomy/chain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@
COMPONENT_REGISTRY_ADDRESS_LOCAL = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
AGENT_REGISTRY_ADDRESS_LOCAL = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
REGISTRIES_MANAGER_ADDRESS_LOCAL = "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
SERVICE_MANAGER_ADDRESS_LOCAL = "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49"
SERVICE_REGISTRY_ADDRESS_LOCAL = "0x998abeb3E57409262aE5b751f60747921B33613E"
SERVICE_MANAGER_ADDRESS_LOCAL = "0x4c5859f0F772848b2D91F1D83E2Fe57935348029"
GNOSIS_SAFE_MULTISIG_ADDRESS_LOCAL = "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF"


# contract addresses from `https://github.com/valory-xyz/autonolas-registries/blob/main/docs/mainnet_addresses.json` file
COMPONENT_REGISTRY_ADDRESS_ETHEREUM = "0x15bd56669F57192a97dF41A2aa8f4403e9491776"
AGENT_REGISTRY_ADDRESS_ETHEREUM = "0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112"
REGISTRIES_MANAGER_ADDRESS_ETHEREUM = "0x9eC9156dEF5C613B2a7D4c46C383F9B58DfcD6fE"
SERVICE_MANAGER_ADDRESS_ETHEREUM = "0x38b062d11CD7596Ab5aDFe4d0e9F0dC3218E5389"
SERVICE_MANAGER_ADDRESS_ETHEREUM = "0x2EA682121f815FBcF86EA3F3CaFdd5d67F2dB143"
SERVICE_REGISTRY_ADDRESS_ETHEREUM = "0x48b6af7B12C71f09e2fC8aF4855De4Ff54e775cA"
GNOSIS_SAFE_MULTISIG_ADDRESS_ETHEREUM = "0x1c2cD884127b080F940b7546c1e9aaf525b1FA55"

# contract addresses from `https://raw.githubusercontent.com/valory-xyz/autonolas-registries/main/scripts/deployment/globals_goerli.json`
COMPONENT_REGISTRY_ADDRESS_GOERLI = "0x7Fd1F4b764fA41d19fe3f63C85d12bf64d2bbf68"
AGENT_REGISTRY_ADDRESS_GOERLI = "0xEB5638eefE289691EcE01943f768EDBF96258a80"
REGISTRIES_MANAGER_ADDRESS_GOERLI = "0x10c5525F77F13b28f42c5626240c001c2D57CAd4"
SERVICE_MANAGER_ADDRESS_GOERLI = "0xcDdD9D9ABaB36fFa882530D69c73FeE5D4001C2d"
SERVICE_MANAGER_ADDRESS_GOERLI = "0x1d333b46dB6e8FFd271b6C2D2B254868BD9A2dbd"
SERVICE_REGISTRY_ADDRESS_GOERLI = "0x1cEe30D08943EB58EFF84DD1AB44a6ee6FEff63a"
GNOSIS_SAFE_MULTISIG_ADDRESS_GOERLI = "0x65dD51b02049ad1B6FF7fa9Ea3322E1D2CAb1176"

Expand Down
28 changes: 13 additions & 15 deletions autonomy/chain/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def token_retriever() -> bool:
raise FailedToRetrieveTokenId(str(e)) from e


def mint_service( # pylint: disable=too-many-arguments
def mint_service( # pylint: disable=too-many-arguments,too-many-locals
ledger_api: LedgerApi,
crypto: Crypto,
metadata_hash: str,
Expand Down Expand Up @@ -252,31 +252,29 @@ def mint_service( # pylint: disable=too-many-arguments
threshold=threshold,
raise_on_try=True,
)
transact(
tx_receipt = transact(
ledger_api=ledger_api,
crypto=crypto,
tx=tx,
)
if tx_receipt is None:
return None
except RequestsConnectionError as e:
raise ComponentMintFailed("Cannot connect to the given RPC") from e

try:

def token_retriever() -> bool:
"""Retrieve token"""
return (
registry_contracts.service_registry.filter_token_id_from_emitted_events(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
SERVICE_REGISTRY_CONTRACT.name
).contracts[chain_type],
)
)
def token_retriever() -> bool:
"""Retrieve token"""
return registry_contracts.service_registry.filter_token_id_from_emitted_events(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
SERVICE_REGISTRY_CONTRACT.name
).contracts[chain_type],
)

try:
return wait_for_component_to_mint(
token_retriever=token_retriever, timeout=timeout
)

except RequestsConnectionError as e:
raise FailedToRetrieveTokenId(
"Connection interrupted while waiting for the unitId emit event"
Expand Down
60 changes: 32 additions & 28 deletions autonomy/cli/helpers/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def mint_component( # pylint: disable=too-many-arguments, too-many-locals
owner: Optional[str] = None,
password: Optional[str] = None,
skip_hash_check: bool = False,
skip_dependencies_check: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be set by the framework so user doesn't have to. Rule: if l2 (network other than ethereum) don't need it ever. If Network ethereum, give user choice.

timeout: Optional[float] = None,
hwi: bool = False,
) -> None:
Expand Down Expand Up @@ -199,20 +200,21 @@ def mint_component( # pylint: disable=too-many-arguments, too-many-locals
f"Please provide hash for NFT image to mint component on `{chain_type.value}` chain"
)

try:
verify_component_dependencies(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
COMPONENT_REGISTRY_CONTRACT.name
).contracts[chain_type],
dependencies=dependencies,
package_configuration=package_configuration,
skip_hash_check=skip_hash_check,
)
except FailedToRetrieveComponentMetadata as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
except DependencyError as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
if not skip_dependencies_check:
try:
verify_component_dependencies(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
COMPONENT_REGISTRY_CONTRACT.name
).contracts[chain_type],
dependencies=dependencies,
package_configuration=package_configuration,
skip_hash_check=skip_hash_check,
)
except FailedToRetrieveComponentMetadata as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
except DependencyError as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e

metadata_hash, metadata_string = publish_metadata(
package_id=package_configuration.package_id,
Expand Down Expand Up @@ -267,6 +269,7 @@ def mint_service( # pylint: disable=too-many-arguments, too-many-locals
owner: Optional[str] = None,
password: Optional[str] = None,
skip_hash_check: bool = False,
skip_dependencies_check: bool = False,
timeout: Optional[float] = None,
hwi: bool = False,
) -> None:
Expand Down Expand Up @@ -302,20 +305,21 @@ def mint_service( # pylint: disable=too-many-arguments, too-many-locals
f"Please provide hash for NFT image to mint component on `{chain_type.value}` chain"
)

try:
verify_service_dependencies(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
AGENT_REGISTRY_CONTRACT.name
).contracts[chain_type],
agent_id=agent_id,
service_configuration=cast(Service, package_configuration),
skip_hash_check=skip_hash_check,
)
except FailedToRetrieveComponentMetadata as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
except DependencyError as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
if not skip_dependencies_check:
try:
verify_service_dependencies(
ledger_api=ledger_api,
contract_address=ContractConfigs.get(
AGENT_REGISTRY_CONTRACT.name
).contracts[chain_type],
agent_id=agent_id,
service_configuration=cast(Service, package_configuration),
skip_hash_check=skip_hash_check,
)
except FailedToRetrieveComponentMetadata as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e
except DependencyError as e:
raise click.ClickException(f"Dependency verification failed; {e}") from e

metadata_hash, metadata_string = publish_metadata(
package_id=package_configuration.package_id,
Expand Down
13 changes: 13 additions & 0 deletions autonomy/cli/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,23 @@
is_flag=True,
help="Skip hash check when verifying dependencies on chain",
)
@click.option(
"--skip-dependencies-check",
is_flag=True,
help="Skip dependencies check.",
)
def mint( # pylint: disable=too-many-arguments
ctx: Context,
chain_type: str,
skip_hash_check: bool,
skip_dependencies_check: bool,
timeout: float,
) -> None:
"""Mint component on-chain."""

ctx.config["chain_type"] = ChainType(chain_type)
ctx.config["skip_hash_check"] = skip_hash_check
ctx.config["skip_dependencies_check"] = skip_dependencies_check
ctx.config["timeout"] = timeout


Expand Down Expand Up @@ -132,6 +139,7 @@ def protocol( # pylint: disable=too-many-arguments
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
Expand Down Expand Up @@ -168,6 +176,7 @@ def contract( # pylint: disable=too-many-arguments
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
Expand Down Expand Up @@ -204,6 +213,7 @@ def connection( # pylint: disable=too-many-arguments
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
Expand Down Expand Up @@ -240,6 +250,7 @@ def skill( # pylint: disable=too-many-arguments
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
Expand Down Expand Up @@ -276,6 +287,7 @@ def agent( # pylint: disable=too-many-arguments
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
Expand Down Expand Up @@ -343,6 +355,7 @@ def service( # pylint: disable=too-many-arguments # pylint: disable=too-many-a
nft=nft,
owner=owner,
skip_hash_check=ctx.config.get("skip_hash_check", False),
skip_dependencies_check=ctx.config.get("skip_dependencies_check", False),
timeout=ctx.config["timeout"],
hwi=hwi,
)
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:bafybeibxprbas6islpxzjr2jz7gig5m6o233p3xkdr3etx32xdeuqbbb44"
ABSTRACT_ROUND_ABCI_SKILL_WITH_HASH = "valory/abstract_round_abci:0.1.0:bafybeidfqzgvrpdqecjcbfyai2sabtfkgabtd4xr7csy77umwvop4xdzhu"
2 changes: 1 addition & 1 deletion deployments/Dockerfiles/autonomy-user/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open-autonomy[all]==0.10.10.post1
open-autonomy[all]==0.10.11
open-aea[all]==1.37.0
open-aea-cli-ipfs==1.37.0
open-aea-ledger-ethereum==1.37.0
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_reference/commands/autonomy_fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ autonomy --registry-path=./packages fetch valory/hello_world:0.1.0 --service --l

Fetch the agent service `hello_world` from a remote registry ([IPFS](https://ipfs.io)):
```bash
autonomy fetch valory/hello_world:0.1.0:bafybeidzji2fkj5rcr2foxy5zirmhi6no2bskt7qz6pweqaiemg4f3pqgq --service --remote
autonomy fetch valory/hello_world:0.1.0:bafybeicsanfqp3pyisb4i4d2muggqtwujommoalgjy56zgaaqgaegtzmr4 --service --remote
```
8 changes: 7 additions & 1 deletion docs/advanced_reference/commands/autonomy_mint.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ This command group consists of a number of functionalities to mint components, a
The options `--use-ethereum`, `--use-goerli`, `--use-custom-chain` and `--use-local` are mutually exclusive.

`--skip-hash-check`
: Skip hash check when verifying dependencies on chain.
: Skip hash check when verifyin--thresholdg dependencies on chain.

`--skip-dependencies-check`
: Skip dependency verification.

## `autonomy mint protocol` / `contract` / `connection` / `skill`

Expand Down Expand Up @@ -168,6 +171,9 @@ autonomy mint service [OPTIONS] PACKAGE_PATH
`--threshold`
: Threshold for the minimum number of agents required to run the service. The threshold has to be at least $\lceil(2N + 1) / 3\rceil$, where $N$ is total number of the agents in the service.

`--l2`
: The chain being used for minting is a layer 2 chain.

### Examples

Mint the `hello_world` service with 4 instances of canonical agent ID 3, cost of bond 10000000000000000 Wei per agent and a threshold of 3 agents, in the Ethereum main chain:
Expand Down
22 changes: 22 additions & 0 deletions docs/api/chain/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def service_manager() -> Contract

Returns an instance of the registries manager contract.

<a id="autonomy.chain.base.RegistryContracts.service_manager_token"></a>

#### service`_`manager`_`token

```python
@property
def service_manager_token() -> Contract
```

Returns an instance of the registries manager contract.

<a id="autonomy.chain.base.RegistryContracts.component_registry"></a>

#### component`_`registry
Expand Down Expand Up @@ -104,3 +115,14 @@ def service_registry() -> Contract

Returns an instance of the registries manager contract.

<a id="autonomy.chain.base.RegistryContracts.service_registry_l2"></a>

#### service`_`registry`_`l2

```python
@property
def service_registry_l2() -> Contract
```

Returns an instance of the registries manager contract.

3 changes: 2 additions & 1 deletion docs/api/chain/mint.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def mint_service(ledger_api: LedgerApi,
cost_of_bond_per_agent: List[int],
threshold: int,
owner: Optional[str] = None,
timeout: Optional[float] = None) -> Optional[int]
timeout: Optional[float] = None,
l2: bool = False) -> Optional[int]
```

Publish component on-chain.
Expand Down
5 changes: 4 additions & 1 deletion docs/api/cli/helpers/chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def mint_component(package_path: Path,
owner: Optional[str] = None,
password: Optional[str] = None,
skip_hash_check: bool = False,
skip_dependencies_check: bool = False,
timeout: Optional[float] = None,
hwi: bool = False) -> None
```
Expand All @@ -54,8 +55,10 @@ def mint_service(package_path: Path,
owner: Optional[str] = None,
password: Optional[str] = None,
skip_hash_check: bool = False,
skip_dependencies_check: bool = False,
timeout: Optional[float] = None,
hwi: bool = False) -> None
hwi: bool = False,
l2: bool = False) -> None
```

Mint service
Expand Down
Loading
Loading