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): Remove non-working FoundryRandom and implement a custom one #13651

Merged
merged 6 commits into from
Apr 26, 2023

Conversation

adaki2004
Copy link
Contributor

FoundryRandom's codebase does not provide us with random variables. (Maybe it's on my machine ((!?)).

You can test it out by putting this debug logging into the current code you have at major_protocol_upgrade_alpha3 's TaikoL1.sim.sol file: (somewhere after the random generation of the respective variables):

            console2.log("-----------------------------");
            console2.log("gasLimit:", gasLimit);
            console2.log("-----------------------------");
            console2.log("gasUsed:", gasUsed);
            console2.log("-----------------------------");
            console2.log("txListSize:", txListSize);
            console2.log("-----------------------------");
            console2.log("blockHash:");
            console2.logBytes32(blockHash);
            console2.log("-----------------------------");
            console2.log("signalRoot:");
            console2.logBytes32(signalRoot);

This branch and PR are solving the problem with a custom randomGenerator with randomNum+salt. (Obviously semi-random, but seems to be working.)

@adaki2004 adaki2004 changed the title Remove non-working FoundryRandom and implement a custom one feat(protocol): Remove non-working FoundryRandom and implement a custom one Apr 25, 2023
@@ -3,7 +3,6 @@ pragma solidity ^0.8.18;

import {Test} from "forge-std/Test.sol";
import {console2} from "forge-std/console2.sol";
import {FoundryRandom} from "foundry-random/FoundryRandom.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also remove it from .gitmodules

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-04-26 at 13 27 44

@adaki2004 adaki2004 merged commit eee153c into major_protocol_upgrade_alpha3 Apr 26, 2023
@adaki2004 adaki2004 deleted the fix_simulation branch April 26, 2023 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📝 Todo
Development

Successfully merging this pull request may close these issues.

2 participants