-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: address filter and chain config #112
Conversation
989b24f
to
7766934
Compare
@@ -33,14 +33,22 @@ As an example, to run the latest version of the watch-tower via `docker`: | |||
docker run --rm -it \ | |||
ghcr.io/cowprotocol/watch-tower:latest \ | |||
run \ | |||
--rpc <rpc-url> \ | |||
--deployment-block <deployment-block> \ | |||
--chain-config <rpc>,<deployment-block> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is a good change. It just couple the RPC and block
I still think the block should be independent and should have a default with the deployment block of the contracts.
Then users can override.
Although probably im missing the why this was necesarry, i guess has to do that in dappnode it was not simple to specify the params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In either which case, then the deployment block in that case would be optional in the chain-config
tuple. Agreed that eventually just publish a composable-cow
NPM package that packages up all this info, that can then be re-exported by the cow-sdk
. I don't think this is a high priority at the moment and would be better served when iterative work is done on the composable-cow
repo with any new order types / interface revision. cowprotocol/composable-cow#60 was created to specifically track this.
The reason to merge them together is to support multi-chain monitoring on DAppNode. Contrary to how the watch-tower is deployed on CoW infra in Kubernetes (where spinning up different deployments is trivial), writing a DAppNode package requires the exact number of containers to be specified for the docker-compose
. Once the package is published, the number of containers is not configurable / changeable. So one cannot dynamically select which networks they want to run, and have DAppNode add / remove containers from the docker-compose
stack.
Alternatives to this include:
- Expand the configuration options to allow for specific chains such as
--mainnet-rpc
etc. - Create a separate DAppNode package per chain.
Neither of the above alternatives are a maintainable solution. Both cause maintenance issues if new networks are added, and (2) incurs 3x the costs (each time a package is published to the DAppNode registry, it costs a transaction on Ethereum Mainnet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expand the configuration options to allow for specific chains such as --mainnet-rpc etc.
This seems nicer, at least keeps the independence of the fields. Its possible that you will keep adding more fields of config per network, and i feel is a red flag to add them as comma separated list
what about, for multi-netork support we add:
First the list of networks:
# Either
---network 1 \
---network 2 \
---network 3 \
Or, a bit less nice
---network 1,2.3
Then the params per network
-- rpc-1 RPC1 \
-- rpc-2 RPC2 \
-- rpc-3 RPC3
# or using the name
-- rpc-mainnet RPC1 \
-- rpc-gc RPC2 \
-- rpc-goerli RPC3
This way, adding new params per network feels more natural.
Imaine if we keep this change, and then we add another parameter.
then we will have --chain-config 1,123456,false,asdfg,
If some are mandatory, and some are not, this will be even more painful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having relationships between fields like this is a bit of a nightmare, and IMO is a great reason for a tuple. It's smelly, but I think there may be a more idiomatic way to do this. Isn't this essentially what is communicated by a URL? (ie. <protocol>://<domain>:<port>/<location>
).
So, in which case, I think I may actually prefer to use a URL with optional query parameters to indicate fields that are optional. Something like:
<rpc>/<deploymentBlock>?watchdogTimeout=30&orderBookApiUrl=urlencodedField
For example, in DAppNode this would be:
http://erigon.dappnode:8545/17883049&watchdogTimeout=60&orderBookApiUrl=https%3A%2F%2Fapi.cow.fi%2Fmainnet
Description
This PR tweaks some configuration options for easing deployment on dappnode.
Changes
rpc
,deploymentBlock
,watchdogTimeout
, andorderBookApi
collapsed down intochain-config
ChainConfig
option parseraddress
filter (only process conditional orders from specific addresses)How to test
Related Issues
Fixes: #72