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

Fix performatives #106

Merged
merged 21 commits into from
Sep 4, 2022
Merged

Fix performatives #106

merged 21 commits into from
Sep 4, 2022

Conversation

Karrenbelt
Copy link
Contributor

@Karrenbelt Karrenbelt commented Sep 2, 2022

the Behaviours have been revisited as it was pointed out that dealing with message performatives was not sufficiently covered #98. When the response is of an incorrect type (e.g. on error) we cannot return.

  • The transaction building contract calls were of the incorrect performative
  • build_safe_raw_tx was not yet in use

In this PR we update behaviours to deal with Optional returns

helper functions introduced:

  • build_keep3r_raw_tx
  • is_workable_job
  • build_work_raw_tx

safe transaction building step added for:

  • BondingBehaviour
  • ActivationBehaviour
  • PerformWorkBehaviour

@Karrenbelt Karrenbelt mentioned this pull request Sep 2, 2022
Comment on lines +265 to +266
if blacklisted is None:
return None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of bubbling up None we could consider raising a custom error.

Copy link
Contributor

Choose a reason for hiding this comment

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

The whole error treatment you have introduced is inconsistent. But I will now merge this as we want to wrap up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to issue #98

This was referenced Sep 2, 2022
Comment on lines +522 to +525
work_tx = yield from self.build_safe_raw_tx(raw_tx)
if work_tx is None:
yield from self.sleep(self.context.params.sleep_time)
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Note, if this returns then we unnecessarily take 517 again. It would be desirable to store locally on behaviour until it either succeeds or gets excited.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to #108

@DavidMinarsch DavidMinarsch merged commit 7bc5e3f into fix/perform_work Sep 4, 2022
@DavidMinarsch DavidMinarsch deleted the fix/performatives branch September 5, 2022 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants