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

[MAINTENANCE] Fix: check-deployed-spell script #419

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

amusingaxl
Copy link
Contributor

Description

Contribution Checklist

  • PR title starts with (PE-<TICKET_NUMBER>)
  • Code approved
  • Tests approved
  • CI Tests pass

Checklist

  • Every contract variable/method declared as public/external private/internal
  • Consider if this PR needs the officeHours modifier override
  • Verify expiration (30 days unless otherwise specified)
  • Verify hash in the description matches here
  • Validate all addresses used are in changelog or known
  • Notify any external teams affected by the spell so they have the opportunity to review
  • Deploy spell ETH_GAS_LIMIT="XXX" ETH_GAS_PRICE="YYY" make deploy
  • Verify mainnet contract on etherscan
  • Change test to use mainnet spell address and deploy timestamp
  • Run make archive-spell or make date="YYYY-MM-DD" archive-spell to make an archive directory and copy DssSpell.sol, DssSpell.t.sol, DssSpell.t.base.sol, and DssSpellCollateralOnboarding.sol
  • squash and merge this PR

@amusingaxl amusingaxl marked this pull request as ready for review July 29, 2024 15:21
Copy link
Contributor

@SidestreamColdMelon SidestreamColdMelon left a comment

Choose a reason for hiding this comment

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

This fixes the problem with ETHERSCAN_API change, therefore approved.

But there is still problem with extra space that breaks two last checks on macOS:

[✔] DssSpell is verified.
[✔] DssSpell was verified with a valid license.
[✔] DssSpell solc version matches.
[✔] DssSpell was not compiled with optimizations.
[✔] DssSpell library matches hardcoded address in DssExecLib.address.
[✖] DssSpell deployment timestamp does not match.
[✖] DssSpell deployment block number does not match.

Do you also want to fix it in the same PR? Simply piping it into another sed to remove all spaces does the trick for me:

deployed_spell_block=$(grep -oE 'deployed_spell_block\s*:\s*[0-9]+' $CONFIG_PATH | sed -E 's/.*:\s*//' | sed -E 's/ //g')
deployed_spell_timestamp=$(grep -oE 'deployed_spell_created\s*:\s*[0-9]+' $CONFIG_PATH | sed -E 's/.*:\s*//' | sed -E 's/ //g')

Otherwise replacing sed with grep also works:

deployed_spell_block=$(grep -oE 'deployed_spell_block\s*:\s*[0-9]+' $CONFIG_PATH | grep -o '[0-9]\+')
deployed_spell_timestamp=$(grep -oE 'deployed_spell_created\s*:\s*[0-9]+' $CONFIG_PATH | grep -o '[0-9]\+')

@amusingaxl
Copy link
Contributor Author

amusingaxl commented Jul 29, 2024

BSD sed and GNU sed vary a lot, I guess grep is the safer approach here.
Let me add it and test to see if nothing breaks on Linux.

Copy link
Contributor

@SidestreamColdMelon SidestreamColdMelon left a comment

Choose a reason for hiding this comment

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

Let me add it and test to see if nothing breaks on Linux.

We can one day add this script to the CI, but the CI would need be skipped in case of the empty address.

Anyway, "it works on my machine", therefore re-approved

Copy link
Collaborator

@0xp3th1um 0xp3th1um left a comment

Choose a reason for hiding this comment

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

(runs also on mine) approved

@amusingaxl amusingaxl merged commit a2bc46e into master Jul 30, 2024
3 checks passed
@amusingaxl amusingaxl deleted the fix/check-deployed-spell-script branch July 30, 2024 12:27
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.

3 participants