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

Remove many fields from ChallengeRegistered event #1592

Merged
merged 6 commits into from
Aug 25, 2023

Conversation

geoknee
Copy link
Contributor

@geoknee geoknee commented Aug 25, 2023

Towards #1588

Justifications:

turnNumRecord -- this is always the turn num of the candidate (emitted)

isFinal -- again this is already emitted in the candidate state

fixedPart: I think it is safe to assume off chain clients have this already, if they are "interested in" this channel id

We can go further

The finalizesAt is easily computable by the event block timestamp plus the challenge duration in the fixed part. Only thing is, we will need to go back to the Ethereum JSON API to get the block timestamp from the blocknumber. If we were using block number- based challenge durations, this problem would go away.

If we are happy to claw information back from the calldata of the transaction causing the event, we probably don't need to re-emit candidate and proof.

These ideas can be the subject of future PRs.

@netlify
Copy link

netlify bot commented Aug 25, 2023

Deploy Preview for nitro-gui canceled.

Name Link
🔨 Latest commit 37921eb
🔍 Latest deploy log https://app.netlify.com/sites/nitro-gui/deploys/64e8e8258911260008c75a51

@netlify
Copy link

netlify bot commented Aug 25, 2023

Deploy Preview for nitro-storybook canceled.

Name Link
🔨 Latest commit 37921eb
🔍 Latest deploy log https://app.netlify.com/sites/nitro-storybook/deploys/64e8e825e82cd800070043aa

@netlify
Copy link

netlify bot commented Aug 25, 2023

👷 Deploy Preview for nitrodocs processing.

Name Link
🔨 Latest commit 37921eb
🔍 Latest deploy log https://app.netlify.com/sites/nitrodocs/deploys/64e8e825c6d4730008ab21c8

turnNumRecord -- this is always the turn num of the candidate (emitted)
isFinal -- again this is already emitted in the candidate state
fixedPart: I think it is safe to assume off chain clients have this already, if they are "interested in" this channel id
this is very fragile :-/
@lalexgap
Copy link
Contributor

If we are happy to claw information back from the calldata of the transaction causing the event, we probably don't need to re-emit candidate and proof.

In theory I think we could just emit a challenge event with the channelId to alert someone a challenge has occurred and the rest of the information could be parsed from the challenge call data. I think you could even avoid events all together by just monitoring blocks for transactions to the adjudicator; although this would be a lot less efficient since you can't utilize the log bloom.

@lalexgap lalexgap merged commit 3dfba12 into main Aug 25, 2023
4 checks passed
@lalexgap lalexgap deleted the challenge-event-slimdown branch August 25, 2023 18:09
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