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

Enhancement of Events in FaultDisputeGame.sol #11409

Open
boyuan-chen opened this issue Aug 8, 2024 · 2 comments
Open

Enhancement of Events in FaultDisputeGame.sol #11409

boyuan-chen opened this issue Aug 8, 2024 · 2 comments

Comments

@boyuan-chen
Copy link
Contributor

Is your feature request related to a problem? Please describe.

It is really hard to find a corresponding FaultDisputeGame on-chain for a specific withdrawal transaction on L2. Users have to loop through all created games to find the right one.

Describe the solution you'd like

One way to solve this problem is to emit the l2BlockNumber and the rootClaim in the Resolved event, so we can use the subgraph to index all events and get the right one or we can directly query events on chain without calling the l2BlockNumber again.

Additional context

We have created this PR to resolve this issue. bobanetwork#226

Does this make sense, and is it helpful for others?

@tynes
Copy link
Contributor

tynes commented Aug 9, 2024

There isn't a 1:1 mapping between a withdrawal transaction and a dispute game as the dispute game is about an output commitment which commits to all previous withdrawals. Are you trying to build a UI? What feature are you trying to build?

@boyuan-chen
Copy link
Contributor Author

For example, if a user performs a withdrawal transaction on L2 at block X, we need to find the corresponding FaultDisputeGame contract on-chain where the L2 block number in this contract is greater than block X, and the previous FaultDisputeGame contract has a l2 block number smaller than block X. This requires looping through all FaultDisputeGame contracts to find the correct one. By emitting this L2 block number in the event, it becomes easier for us to identify the resolved game associated with the correct L2 block number.

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

No branches or pull requests

2 participants