-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix blocking behaviour on Pearl agent #271
Conversation
|
||
# The class StakingState is redefined in several packages. | ||
# This conversion is required to use a single representation. | ||
if not isinstance(state, StakingState): | ||
state = StakingState(state.value) | ||
|
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.
Review this approach
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.
@Adamantios please validate this approach
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.
Can you elaborate? Why is this necessary? It is only specified in the contract from where you imported it.
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.
service_staking_state
is initialized with StakingState
defined in
and
deppending of which of the 2 contracts is being used. These are 2 different classes and when service_staking_state is compared, it will fail if it's not the class defined in this file. For this reason, this patch here ensures that it always uses StakingState imported in this file.
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.
So I think the best approach here would be to revert back to #209 (comment), i.e., revert 93b7dc8.
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.
This branch has already been tested.
I added an issue to ammend on the base branch before merging to main. #280
@@ -79,7 +79,6 @@ models: | |||
redeem_round_timeout: 3600.0 | |||
contract_timeout: 300.0 | |||
file_hash_to_strategies_json: ${FILE_HASH_TO_STRATEGIES_JSON:list:[["bafybeihufqu2ra7vud4h6g2nwahx7mvdido7ff6prwnib2tdlc4np7dw24",["bet_amount_per_threshold"]],["bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq",["kelly_criterion"]]]} | |||
strategies_kwargs: ${STRATEGIES_KWARGS:list:[["bet_kelly_fraction",1],["floor_balance",500000000000000000],["bet_amount_per_threshold",{"0.0":0,"0.1":0,"0.2":0,"0.3":0,"0.4":0,"0.5":0,"0.6":60000000000000000,"0.7":80000000000000000,"0.8":160000000000000000,"0.9":1000000000000000000,"1.0":1000000000000000000}]]} |
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.
@Adamantios This export is causing issues on Pearl when exporting variables. Perhaps open an issue on Open Autonomy. The approach to make it work is to remove the service override and use directly the agent configuration.
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.
As long as it is not removed from the main service file it's fine. Yes, please open an issue too.
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.
Are you sure you can even use overrides on Pearl? From #221 (comment) I understand that it is not possible.
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.
Pearls seems to be using a custom method for overrides, but it's failing for STRATEGIES_KWARGS.
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.
So why are you using FILE_HASH_TO_STRATEGIES_JSON
and STRATEGIES_KWARGS
above?
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.
These work fine. The problem with STRATEGIES_KWARGS
is explained in the description of this PR. #271 (comment)
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.
Let me rephrase. Why are you not using overrides everywhere and effectively duplicating everything (#221 (review))? If the answer is that this approach does not work on Pearl (#221 (comment)), why are you using FILE_HASH_TO_STRATEGIES_JSON
and STRATEGIES_KWARGS
?
This PR fixes several issues that prevent the Pearl agent starting normally.
Several fixes to the staking interaction.
Remove override from service.yaml in trader_omen_gnosis (used in Perl)
The reason for this change is that the environment exports of strategies_kwargs is causing issues in the definition of export variables on Perl; it is producing variables with a period, which is not a valid variable name in bash.