Skip to content

Commit

Permalink
Merge pull request bgd-labs#37 from bgd-labs/fix/fix-ci
Browse files Browse the repository at this point in the history
fix: removed unused paths from certora ci
  • Loading branch information
sendra authored Nov 26, 2024
2 parents 43fd72b + 7a10ada commit 70865bf
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 29 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Comment

on:
workflow_run:
workflows: [Test]
types:
- completed

permissions:
actions: read
issues: write
checks: read
statuses: read
pull-requests: write

jobs:
comment:
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
secrets:
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}
12 changes: 0 additions & 12 deletions .github/workflows/main.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Foundry build n test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: bgd-labs/action-rpc-env@main
with:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}

# we simply use foundry zk for all jobs in this repo
- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@main

- name: Run Forge tests
id: test
uses: bgd-labs/github-workflows/.github/actions/foundry-test@main

- name: Run Gas report
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@main

- name: Run Lcov report
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@main

- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/comment-artifact@main

# we let failing tests pass so we can log them in the comment, still we want the ci to fail
- name: Post test
if: ${{ steps.test.outputs.testStatus != 0 }}
run: |
echo "tests failed"
exit 1
3 changes: 0 additions & 3 deletions security/certora/confs/verifyVotingStrategy_unittests.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/aave-delivery-infrastructure/lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingStrategy:security/certora/specs/VotingStrategy_unittests.spec",
Expand All @@ -24,4 +22,3 @@
"solc": "solc8.19",
"msg": "VotingStrategy tests"
}

2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyLegality.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/legality.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyMisc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarnessTriple:security/certora/specs/voting/misc.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyPower_summary.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarnessTriple:security/certora/specs/voting/power_summary.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyProposal_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/proposal_config.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyProposal_states.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/proposal_states.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyVoting_and_tally.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/voting_and_tally.spec",
Expand Down
9 changes: 7 additions & 2 deletions security/certora/specs/Governance.spec
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ definition state_changing_function(method f) returns bool =
definition initializeSig(method f) returns bool =
f.selector == sig:initialize(address,address,address, IGovernanceCore.SetVotingConfigInput[],address[],uint256,uint256).selector;

definition initializeWithRevisionSig(method f) returns bool =
f.selector == sig:initializeWithRevision(uint256).selector;

definition isTerminalState(IGovernanceCore.State state) returns bool =
state == IGovernanceCore.State.Executed || // 4
state == IGovernanceCore.State.Failed || // 5
Expand Down Expand Up @@ -459,7 +462,7 @@ rule single_state_transition_per_block_non_creator_witness
// A unauthorized user (not an owner) cannot change voting parameters
rule only_owner_can_set_voting_config(method f) filtered {
f -> !f.isView &&
!initializeSig(f) }
!initializeSig(f) && !initializeWithRevisionSig(f)}
{
env e;
calldataarg args;
Expand Down Expand Up @@ -535,7 +538,9 @@ rule guardian_can_cancel()
// Only a guardian, an owner can cancel any proposal, a creator can cancel his own proposal
rule only_guardian_can_cancel(method f)filtered
{ f -> !f.isView &&
!initializeSig(f)
!initializeSig(f)
&& !initializeWithRevisionSig(f) // this function can change the _votingConfigs[proposal.accessLevel].minPropositionPower
// thus invalidates the _isPropositionPowerEnough(...)
}
{
env e1;
Expand Down

0 comments on commit 70865bf

Please sign in to comment.