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

feat(protocol): add lastSyncedBlockId for L2 DAO vote aggregation #16654

Merged
merged 14 commits into from
Apr 5, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Apr 5, 2024

This small feature is added to support future DAO. The DAO will aggregate votes/vetos on L2 which will be bridged to L1. Suppose a DAO proposal has passed its voting period on L1. We need to wait for L2-to-L1 synchronization to happen for at least once before the proposal's state can be finalized. If for some reason L2 blocks is no longer verified, then all DAO proposals will have to wait.

@dantaik dantaik marked this pull request as ready for review April 5, 2024 02:43
Copy link

openzeppelin-code bot commented Apr 5, 2024

feat(protocol): add lastSyncedBlockId for L2 DAO vote aggregation

Generated at commit: 9af4d5af4185b9a4df95eef77fda205b27d8d8cc

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
3
39
46
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik dantaik changed the title feat(protocol): add lastSyncedAt timestamp feat(protocol): add lastSyncedAt timestamp for L2 DAO vote aggregation Apr 5, 2024
@Brechtpd
Copy link
Contributor

Brechtpd commented Apr 5, 2024

I think this will check that some L2 block has synced after the deadline, but it could be a very old L2 block, especially if the block verification is behind (currently always at least 1 day behind I guess). But I think the intention is that all L2 blocks with timestamp < dao.voteDeadlineOnL1 are actually synced so all votes/vetos that happened on L2 before that timestamp are also taken into account? Maybe you could some extra 1 day or something on the DAO side to take this into account, but without checking the L2 block timestamp not sure if you could do it in an accurate way.

@dantaik dantaik changed the title feat(protocol): add lastSyncedAt timestamp for L2 DAO vote aggregation feat(protocol): add lastSyncedAt and lastSyncedBlocKId for L2 DAO vote aggregation Apr 5, 2024
@dantaik
Copy link
Contributor Author

dantaik commented Apr 5, 2024

I think this will check that some L2 block has synced after the deadline, but it could be a very old L2 block, especially if the block verification is behind (currently always at least 1 day behind I guess). But I think the intention is that all L2 blocks with timestamp < dao.voteDeadlineOnL1 are actually synced so all votes/vetos that happened on L2 before that timestamp are also taken into account? Maybe you could some extra 1 day or something on the DAO side to take this into account, but without checking the L2 block timestamp not sure if you could do it in an accurate way.

Good feedback. I change to use lastSyncedBlockId so with we can change the way to verify if a proposal's status can be finalized as:

taikoL2.getBlock(lastSyncedBlockId).proposedAt >  dao.voteDeadlineOnL1 +  dao.voteDeadlineOnL1 + 2days

@dantaik dantaik changed the title feat(protocol): add lastSyncedAt and lastSyncedBlocKId for L2 DAO vote aggregation feat(protocol): add lastSyncedBlockId for L2 DAO vote aggregation Apr 5, 2024
@dantaik dantaik requested a review from smtmfft April 5, 2024 06:49
@dantaik dantaik enabled auto-merge April 5, 2024 06:49
@dantaik dantaik added this pull request to the merge queue Apr 5, 2024
Merged via the queue into main with commit edbae8d Apr 5, 2024
10 checks passed
@dantaik dantaik deleted the lastSyncedAt branch April 5, 2024 06:54
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.

4 participants