Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Support prevrandao opcode #1376

Closed
ChihChengLiang opened this issue Apr 28, 2023 · 16 comments · Fixed by #1648
Closed

Support prevrandao opcode #1376

ChihChengLiang opened this issue Apr 28, 2023 · 16 comments · Fixed by #1648
Labels
T-feature Type: new features

Comments

@ChihChengLiang
Copy link
Collaborator

ChihChengLiang commented Apr 28, 2023

After the Merge, the DIFFICULTY opcode was renamed to PREVRANDAO

            difficulty: if eth_block.difficulty.is_zero() {
                eth_block
                    .mix_hash
                    .unwrap_or_default()
                    .to_fixed_bytes()
                    .into()
            } else {
                eth_block.difficulty
            },

another remainder is that we need to support prevrandao opcode (renamed from DIFFICULTY). I make this change https://github.com/scroll-tech/zkevm-circuits/blob/1ea9b5970ff873191de29e625687765f427326dd/bus-mapping/src/circuit_input_builder/block.rs#L119-L127 to be compatible with latest node/libs.

Originally posted by @lispc in #1362 (comment)

References

@ameya-deshmukh
Copy link

@ChihChengLiang is this open to take up?

@ChihChengLiang
Copy link
Collaborator Author

Hi @ameya-deshmukh,
Thanks for your interest in contributing to this task.
Yes, the issue is open to take up. But it would be great if you could help update the spec first privacy-scaling-explorations/zkevm-specs#437.

@ameya-deshmukh
Copy link

Great, thank you!

@dyxushuai
Copy link
Contributor

dyxushuai commented Aug 21, 2023

Is this issue working in progress? Maybe I can help for it, we met this issue and added in our project. @ChihChengLiang @ameya-deshmukh

@ChihChengLiang
Copy link
Collaborator Author

Hi @ameya-deshmukh, Can you give an update? It's okay if you are too busy and not able to work on this task.

@KimiWu123 KimiWu123 self-assigned this Aug 31, 2023
@KimiWu123 KimiWu123 added this to the Feature Completeness milestone Aug 31, 2023
@KimiWu123 KimiWu123 moved this to 🏗 In progress in zkEVM Community Edition Aug 31, 2023
@KimiWu123 KimiWu123 added the T-feature Type: new features label Aug 31, 2023
@KimiWu123 KimiWu123 removed their assignment Aug 31, 2023
@KimiWu123 KimiWu123 moved this from 🏗 In progress to 🤝External Help in zkEVM Community Edition Aug 31, 2023
@dyxushuai
Copy link
Contributor

Hi @ameya-deshmukh, Can you give an update? It's okay if you are too busy and not able to work on this task.

So, may I claim this?

@ameya-deshmukh
Copy link

Hey @dyxushuai would you like to work on it together? I wasn't able to get started on this.

@dyxushuai
Copy link
Contributor

Hey @dyxushuai would you like to work on it together? I wasn't able to get started on this.

Of course, I will begin to do this ASAP

@ameya-deshmukh
Copy link

Where can we communicate? We can split up the tasks.

@dyxushuai
Copy link
Contributor

@ameya-deshmukh You can email me by johnxu@duck.com

@dyxushuai
Copy link
Contributor

difficulty: if eth_block.difficulty.is_zero() {
eth_block
.mix_hash
.unwrap_or_default()
.to_fixed_bytes()
.into()
} else {
eth_block.difficulty
},

I think this logic is good enough to fit the eip-4399 🐶, but we don't like Geth, we don't have flags for features or forks, so we can only keep forward compatibility

@KimiWu123
Copy link
Contributor

Hey @dyxushuai and @ameya-deshmukh, could you give an update? It's fine if both of you are busy and unable to work on this task.

@dyxushuai
Copy link
Contributor

Where can we communicate? We can split up the tasks.

Hey @dyxushuai and @ameya-deshmukh, could you give an update? It's fine if both of you are busy and unable to work on this task.

Sorry, I think @ameya-deshmukh didn't message me. So, I will give a PR in the next few days alone.

@ameya-deshmukh
Copy link

Sure! Sorry I couldn't devote time to this.

@ed255
Copy link
Member

ed255 commented Oct 5, 2023

It seems no one is currently working on this issue, so I left it unassigned (please let me know if this is not the case!)

@ed255 ed255 moved this from 🤝External Help to Milestone Tasks in zkEVM Community Edition Oct 5, 2023
@KimiWu123 KimiWu123 moved this from Milestone Tasks to 📋 Sprint Focus in zkEVM Community Edition Oct 6, 2023
@dyxushuai
Copy link
Contributor

It seems no one is currently working on this issue, so I left it unassigned (please let me know if this is not the case!)

Sorry, I just got back from a long vacation. (2 weeks)

@ed255 @KimiWu123 #1648 This is my implementation of prevrandao opcode. If you find any problems, please let me know, for now, I can respond ASAP.

github-merge-queue bot pushed a commit that referenced this issue Oct 11, 2023
@KimiWu123 KimiWu123 moved this from 📋 Sprint Focus to ✅ Done in zkEVM Community Edition Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-feature Type: new features
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants