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

There should be a SolutionReversion event #620

Open
e00E opened this issue Mar 26, 2020 · 1 comment
Open

There should be a SolutionReversion event #620

e00E opened this issue Mar 26, 2020 · 1 comment
Labels
Version2 Proposals for the version 2 contract

Comments

@e00E
Copy link
Contributor

e00E commented Mar 26, 2020

I noticed this when implementing an orderbook based only on events.

We emit a SolutionSubmission event when a solution is accepted. This event allows us to update the solution submitter's fee token balance based on solution fee reward (their OWL balance increases). Handling this properly is needed in the orderbook because we need to know accurate balances for all users. This includes the solution submitter in case they decide to participate in trading, too.

When a solution is reverted we correctly emit a TradeReversion event for each trade but we silently decrease the previously granted solution free reward. This goes unnoticed in the orderbook.

There is a workaround: We can keep track of the latest solution submitter and granted reward. When we notice any TradeReversion we know the solution must have been reverted and deduct the reward again and delete our record of the latest solution (so that we don't deduct it multiple times).
I think this works in every case but it doesn't feel intended.

@e00E e00E changed the title There should be a SolutionReverted event There should be a SolutionReversion event Mar 26, 2020
@nlordell
Copy link
Contributor

nlordell commented Apr 5, 2020

We can keep track of the latest solution submitter and granted reward. When we notice any TradeReversion we know the solution must have been reverted and deduct the reward again and delete our record of the latest solution (so that we don't deduct it multiple times).

If I understand everything correctly, shouldn't a new SolutionSubmission for the same batch just revert the fee transfer to the solution submitter in case there was a previous solution submission? I think that feels less hacky than using TradeReversion events.

@fleupold fleupold added the Version2 Proposals for the version 2 contract label Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Version2 Proposals for the version 2 contract
Projects
None yet
Development

No branches or pull requests

3 participants