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

AIP 6: Security council Elections #87

Merged
merged 716 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
716 commits
Select commit Hold shift + click to select a range
ad5a933
enforce manager updates ordering
godzillaba Jul 24, 2023
087d9b8
...
godzillaba Jul 24, 2023
aaab983
comments on member counting
godzillaba Jul 24, 2023
d96f453
test topNominees gas
godzillaba Jul 24, 2023
8028307
remove console log
godzillaba Jul 24, 2023
013d8ed
update topNominees gas comment
godzillaba Jul 24, 2023
08ed4ba
lint and snapshot
godzillaba Jul 25, 2023
5d7deb6
general kv store
godzillaba Jul 25, 2023
6f3ad74
make UpgradeActionStorage.computeKey public
godzillaba Jul 25, 2023
4de3e97
Merge pull request #151 from ArbitrumFoundation/security-council-mgmt…
godzillaba Jul 25, 2023
6db1029
separate files
godzillaba Jul 25, 2023
1e19c86
cannot createElection until previous member election has executed
godzillaba Jul 25, 2023
d489703
governors comments
godzillaba Jul 25, 2023
397b98d
more governors comments
godzillaba Jul 25, 2023
11e1cbb
comments ISecurityCouncilManager
godzillaba Jul 25, 2023
f0efa56
remove unused interface
godzillaba Jul 25, 2023
085bfa8
comments security-council-mgmt
godzillaba Jul 25, 2023
fcb2bfa
comments done
godzillaba Jul 25, 2023
5e23e97
add a comment
godzillaba Jul 26, 2023
d1c0511
...
godzillaba Jul 26, 2023
85ac4ef
Merge pull request #154 from ArbitrumFoundation/security-council-mgmt…
godzillaba Jul 26, 2023
7fb0c9e
minor updates
godzillaba Jul 26, 2023
53b978d
...
godzillaba Jul 26, 2023
861f148
rename to ExecutionRecord
godzillaba Jul 26, 2023
c76c8c9
format
godzillaba Jul 26, 2023
5010b47
Merge pull request #152 from ArbitrumFoundation/security-council-mgmt…
godzillaba Jul 27, 2023
f1567c6
start security-council-mgmt.md
godzillaba Jul 27, 2023
449ce64
Added some comments and re-arranged files
yahgwai Jul 27, 2023
afc02a2
fix existing tests, add LastMemberElectionNotExecuted test
godzillaba Jul 27, 2023
b9579b3
test sync action nonces
godzillaba Jul 27, 2023
bbdfd8e
Merge branch 'security-council-mgmt--base2' into security-council-mgm…
godzillaba Jul 27, 2023
d572d2e
format + snapshot
godzillaba Jul 27, 2023
f34fac1
...
godzillaba Jul 27, 2023
d94728b
includeNominee can be called after vetting deadline
godzillaba Jul 31, 2023
2f800c4
update includeNominee tests
godzillaba Jul 31, 2023
12e5e84
member gov disable initializers
godzillaba Jul 31, 2023
6d422a8
new expire module
godzillaba Jul 31, 2023
84cbfda
format + removal gov inherits expire
godzillaba Jul 31, 2023
a5a6979
Merge pull request #157 from ArbitrumFoundation/security-council-mgmt…
godzillaba Jul 31, 2023
ebb6d4d
Merge branch 'security-council-mgmt--base2' into security-council-mgm…
godzillaba Jul 31, 2023
edc9aff
contract size job
godzillaba Jul 31, 2023
6cec5df
test without profile var
godzillaba Jul 31, 2023
f214658
with profile
godzillaba Jul 31, 2023
4ceaf9f
expiration tests
godzillaba Jul 31, 2023
b4e75f9
Merge pull request #150 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
4b5dcbd
Added configureability of expiration blocks
yahgwai Aug 1, 2023
ff147d4
Merge pull request #159 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
d5fb792
Merge pull request #156 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
89b38fe
Merge pull request #162 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
8f6861b
Updated docs
yahgwai Aug 1, 2023
2adce84
update remappings to include solady contracts
fredlacs Aug 1, 2023
c3fbf63
add command to test only security council election contracts
fredlacs Aug 1, 2023
17ee81f
noop, don't revert, if SecurityCouncilMemberSyncAction nonce is too l…
DZGoldman Aug 1, 2023
8499ca5
Merge pull request #158 from ArbitrumFoundation/security-council-mgmt…
godzillaba Aug 1, 2023
dd3ae99
handle solady as a npm dependency
fredlacs Aug 1, 2023
dd1d7dc
update comment and event
DZGoldman Aug 1, 2023
d5a5e58
remove out of date initialize comment
DZGoldman Aug 1, 2023
284e4e9
pin correct versions
fredlacs Aug 1, 2023
da640c4
Merge pull request #168 from ArbitrumFoundation/remove-comment
DZGoldman Aug 1, 2023
39710cd
Merge pull request #164 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 1, 2023
9ea09b0
format, update snapshot
DZGoldman Aug 1, 2023
be0678d
Revert "handle solady as a npm dependency"
fredlacs Aug 1, 2023
60a49d5
add hardhat forge plugin
fredlacs Aug 1, 2023
5c71c0b
Update src/security-council-mgmt/governors/modules/SecurityCouncilNom…
DZGoldman Aug 1, 2023
96c9ed7
Merge pull request #155 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
6d69c33
Merge pull request #153 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 1, 2023
372bb5c
Merge pull request #165 from ArbitrumFoundation/housekeeping
yahgwai Aug 1, 2023
3bec83d
Updated build toml
yahgwai Aug 1, 2023
c21454d
update hardhat config
godzillaba Aug 1, 2023
44f8abe
Merge branch 'main' into security-council-mgmt--base
godzillaba Aug 1, 2023
35975ab
Added more docs on security council elections
yahgwai Aug 1, 2023
573c94a
Updated top nominees
yahgwai Aug 1, 2023
c36c8fe
Merge branch 'scm--base-size' into scm--chris-docs
yahgwai Aug 1, 2023
ed50a4e
Added tolerance of 1
yahgwai Aug 1, 2023
b5f2498
Added color diagram
yahgwai Aug 1, 2023
a530cca
config comments
godzillaba Aug 1, 2023
591f1f8
Merge pull request #169 from ArbitrumFoundation/scm--base-size
yahgwai Aug 1, 2023
f139a4f
Added comment in execution record
yahgwai Aug 1, 2023
3b5d8a6
Update docs/security-council-manager.md
DZGoldman Aug 1, 2023
cf3d543
Updated comments
yahgwai Aug 1, 2023
2b3ff48
Update docs/security-council-manager.md
yahgwai Aug 1, 2023
6612e7c
Update docs/security-council-manager.md
yahgwai Aug 1, 2023
088c88e
Update docs/security-council-manager.md
yahgwai Aug 1, 2023
14494ee
Fix typo
yahgwai Aug 1, 2023
c45b7e1
git Merge branch 'scm--chris-docs' of https://github.com/ArbitrumFoun…
yahgwai Aug 1, 2023
dc8b8bc
Update docs/security-council-manager.md
DZGoldman Aug 1, 2023
8e865f0
Merge branch 'security-council-mgmt--base' into scm--chris-docs
yahgwai Aug 1, 2023
aa81c02
Merge branch 'scm--chris-docs' of https://github.com/ArbitrumFoundati…
yahgwai Aug 1, 2023
c3b8db0
Update docs/security-council-mgmt.md
DZGoldman Aug 1, 2023
05a08e9
Update docs/security-council-mgmt.md
DZGoldman Aug 1, 2023
ea87f67
Update docs/security-council-nominee-vetting.md
DZGoldman Aug 1, 2023
aeef20d
Update docs/security-council-nominee-vetting.md
DZGoldman Aug 1, 2023
c6fa6a0
Update docs/security-council-nominee-vetting.md
DZGoldman Aug 1, 2023
c18de53
Merge pull request #171 from ArbitrumFoundation/scm--chris-docs
yahgwai Aug 1, 2023
dade2a1
almost finished with draft stub election deploy script
godzillaba Aug 2, 2023
a3b8cdd
...
godzillaba Aug 2, 2023
6b7d74d
...
godzillaba Aug 2, 2023
4b11be5
Merge branch 'security-council-mgmt--base' into security-council-mgmt…
godzillaba Aug 2, 2023
22aa52c
Merge branch 'security-council-mgmt--deploy-scripts' into scm-stub-fa…
godzillaba Aug 2, 2023
8fe69b1
expire blocks
godzillaba Aug 2, 2023
0649cc0
package.json scripts
godzillaba Aug 3, 2023
24cac93
remove async
godzillaba Aug 3, 2023
0d3a6d8
wip
godzillaba Aug 4, 2023
61361cc
deploy script works
godzillaba Aug 4, 2023
6056005
qol
godzillaba Aug 4, 2023
fd13b3b
configs done
godzillaba Aug 4, 2023
f8475dd
main
godzillaba Aug 4, 2023
46a50fa
update package scripts
godzillaba Aug 4, 2023
260a675
indentation, yarn script change
godzillaba Aug 4, 2023
c6ab069
remove bad type hack
godzillaba Aug 4, 2023
aee5a25
indentation
godzillaba Aug 4, 2023
a297c7d
rename
godzillaba Aug 4, 2023
be6ec60
add storage gap to upgradeable contracts
DZGoldman Aug 7, 2023
75db9f8
emit value set event in KeyValueStore
DZGoldman Aug 7, 2023
2f47f4c
index more event fields in SecurityCouncilManager
DZGoldman Aug 7, 2023
71cc7dd
fix comment typos
DZGoldman Aug 7, 2023
f08ee9d
use standard constant casing for VOTE_SUCCESS_DENOMINATOR
DZGoldman Aug 7, 2023
891fa53
Merge branch 'scm-deploy-scripts' into scm-stub-factory
godzillaba Aug 8, 2023
9879c3c
fix dummy election script
godzillaba Aug 8, 2023
80dc3a7
Merge pull request #191 from OffchainLabs/scm-stub-factory
godzillaba Aug 8, 2023
eeca945
indentation
godzillaba Aug 8, 2023
be9cd39
deploy activation contracts
godzillaba Aug 8, 2023
554b1ce
find testnet council addresses
godzillaba Aug 8, 2023
9c33691
generateProposalData.ts
godzillaba Aug 8, 2023
b4c5cec
comment
godzillaba Aug 9, 2023
7ab7bf2
jsdoc comment
godzillaba Aug 9, 2023
d9da399
Merge pull request #194 from OffchainLabs/scm-deploy-activation
godzillaba Aug 9, 2023
692a47d
Merge pull request #192 from OffchainLabs/scm-deploy-scripts
godzillaba Aug 9, 2023
462520a
decode sendTxToL1
godzillaba Aug 9, 2023
7c0c9c5
generalize
godzillaba Aug 9, 2023
96d9243
...
godzillaba Aug 9, 2023
e7574a5
wait for deployment receipts
godzillaba Aug 9, 2023
c7d5f0a
wip
godzillaba Aug 9, 2023
0f90399
works, but proxies not verified
godzillaba Aug 9, 2023
551044f
Merge pull request #197 from OffchainLabs/scm-deploy-fix
godzillaba Aug 9, 2023
4c0715c
works
godzillaba Aug 9, 2023
aa69f81
...
godzillaba Aug 9, 2023
530f086
add route builder and rename a variable
godzillaba Aug 9, 2023
d3aeb59
remove redundant loop in areAddressArraysEqual, rename, add comment
DZGoldman Aug 10, 2023
afa99d8
explicit solc version in foundry.toml
godzillaba Aug 10, 2023
05acd8c
Merge branch 'public-main-base' into security-council-mgmt--base
godzillaba Aug 10, 2023
a876990
add comments in selectTopNominees
DZGoldman Aug 10, 2023
18946e3
Added replay protection for castVoteWithReasonAndParamsBySig
yahgwai Aug 11, 2023
eac41c3
Updated gas snapshot
yahgwai Aug 11, 2023
66b533d
Updated foundry and gas snapshot
yahgwai Aug 11, 2023
1a6b66d
Missing gov init
yahgwai Aug 11, 2023
aa12398
Updated gas snapshot
yahgwai Aug 11, 2023
ff90998
Merge pull request #200 from OffchainLabs/sec-removal-gov-init
yahgwai Aug 11, 2023
94fb470
Merge pull request #196 from OffchainLabs/scm-generate-proposal
godzillaba Aug 11, 2023
a4820b5
Merge from main public
yahgwai Aug 11, 2023
15cbd30
Update src/security-council-mgmt/governors/modules/SecurityCouncilMem…
godzillaba Aug 11, 2023
8d726af
Gas snapshot update
yahgwai Aug 11, 2023
97e6289
Merge from base
yahgwai Aug 11, 2023
99ba45b
Merge branch 'security-council-mgmt--base' into security-council-mgmt…
yahgwai Aug 11, 2023
1eb3124
Updated snapshot
yahgwai Aug 11, 2023
8f00227
Updated gaps
yahgwai Aug 11, 2023
4f37b37
Updated doc
yahgwai Aug 11, 2023
2e78e5d
Merge pull request #193 from OffchainLabs/security-council-mgmt--post…
yahgwai Aug 11, 2023
b0cd434
Merge from base
yahgwai Aug 11, 2023
0a4322a
Merge pull request #199 from OffchainLabs/sec-cast-vote-sig-replay
yahgwai Aug 11, 2023
e6822b6
Removed TODO
yahgwai Aug 11, 2023
b480482
Merge branch 'security-council-mgmt--base' into scm-verify-contracts2
yahgwai Aug 11, 2023
6199ae7
Merge pull request #198 from OffchainLabs/scm-verify-contracts2
yahgwai Aug 11, 2023
14e7445
Updated doces
yahgwai Aug 14, 2023
682cecc
Updated docs
yahgwai Aug 14, 2023
0a9f575
Merge pull request #174 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 14, 2023
2feb49b
Merge pull request #177 from ArbitrumFoundation/scm-c4-192
DZGoldman Aug 14, 2023
40c7d52
Merge pull request #178 from ArbitrumFoundation/scm-c4-188
DZGoldman Aug 14, 2023
07170fb
Check for duplicates in sec council init
yahgwai Aug 14, 2023
659407d
deploy gnosis safes properly and change hardhat config
godzillaba Aug 14, 2023
02dd8b0
fixed no await for transaction receipts
godzillaba Aug 14, 2023
defa2b1
add add/remove security council to docs
DZGoldman Aug 14, 2023
a10f1a7
Shortened check
yahgwai Aug 15, 2023
2c454c8
Merge pull request #180 from ArbitrumFoundation/scm-c4-122
yahgwai Aug 15, 2023
dff7ff0
Merge pull request #182 from ArbitrumFoundation/security-council-mgmt…
yahgwai Aug 15, 2023
10e8c64
Updated bypasss for GHSA-g4vp-m682-qqmp
yahgwai Aug 15, 2023
97ae139
Additional checks that sentinal and sec council are made owners
yahgwai Aug 15, 2023
c049691
Change vote succeeded to be >=
yahgwai Aug 15, 2023
c3b6bfa
Added comment about setting full weight duration
yahgwai Aug 15, 2023
fe5dd41
Merge pull request #183 from ArbitrumFoundation/sec-coun-yarn-audit
yahgwai Aug 15, 2023
498d4af
Added docs on block periods
yahgwai Aug 15, 2023
76b7fb9
Added more to include address guidance
yahgwai Aug 15, 2023
f75666e
Updated salt to use .encode
yahgwai Aug 15, 2023
7bfce5c
Merge branch 'security-council-mgmt--base' into scm-c4-91
yahgwai Aug 15, 2023
4681868
Updated typo
yahgwai Aug 15, 2023
ec48c60
Merge branch 'scm-c4-91' into scm-c4-147
yahgwai Aug 15, 2023
cdd4d53
Made checkMember public and called from nominee gov
yahgwai Aug 15, 2023
7a65889
Merge pull request #187 from ArbitrumFoundation/scm-c4-80
DZGoldman Aug 15, 2023
c51de30
Merge pull request #188 from ArbitrumFoundation/scm-c4-165
DZGoldman Aug 15, 2023
4321a6b
Merge pull request #184 from ArbitrumFoundation/scm-c4-52
DZGoldman Aug 15, 2023
e8d4aa9
Update src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol
yahgwai Aug 15, 2023
181a712
Merge pull request #189 from ArbitrumFoundation/scm-c4-147
yahgwai Aug 15, 2023
0314dd1
Update scripts/security-council-mgmt-deployment/deployContracts.ts
godzillaba Aug 15, 2023
caa5adc
...
godzillaba Aug 15, 2023
a6510c1
Merge branch 'security-council-mgmt--base' into scm-deploy-gnosis-saf…
godzillaba Aug 15, 2023
48d10bf
include new constitution hash in GovernanceChainSCMgmtActivationAction
DZGoldman Aug 15, 2023
89c59e0
Merge pull request #186 from ArbitrumFoundation/scm-c4-66
yahgwai Aug 15, 2023
a94e05c
Reverted changes in Sec council managemenbt
yahgwai Aug 15, 2023
0064455
Updated merge from 91
yahgwai Aug 15, 2023
cc1ca86
Merge pull request #192 from ArbitrumFoundation/scm-c4-147
yahgwai Aug 15, 2023
f1b035d
Updated snapshot
yahgwai Aug 15, 2023
116413c
Removed sentinel owner err
yahgwai Aug 15, 2023
3433dd0
Updated snapshot
yahgwai Aug 15, 2023
bc68750
Removed member error
yahgwai Aug 15, 2023
591ed58
Merge pull request #185 from ArbitrumFoundation/scm-c4-91
yahgwai Aug 15, 2023
376c682
update constitution hash
DZGoldman Aug 15, 2023
f640bee
fix bytes 32
DZGoldman Aug 15, 2023
97640c1
update snapshot
DZGoldman Aug 15, 2023
5083b42
merge base, update snapshot
DZGoldman Aug 15, 2023
4ba5003
Merge pull request #191 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 15, 2023
21d257b
update snapshot
DZGoldman Aug 15, 2023
031cb8a
update snapshot
DZGoldman Aug 15, 2023
46dd56f
Merge pull request #181 from ArbitrumFoundation/scm-deploy-gnosis-saf…
DZGoldman Aug 15, 2023
3519a5a
remove unused config
godzillaba Aug 15, 2023
c08957e
Merge pull request #193 from ArbitrumFoundation/scm-remove-gnosis-dep…
godzillaba Aug 15, 2023
d9e6312
Added audit report
yahgwai Aug 15, 2023
c0b6602
Merge branch 'security-council-mgmt--base' of https://github.com/Arbi…
yahgwai Aug 15, 2023
6413778
Moved elections audit
yahgwai Aug 15, 2023
be47002
Updated snapshot
yahgwai Aug 15, 2023
3b14752
Added nominee vetter wallet
yahgwai Aug 15, 2023
57a082d
Merge pull request #194 from ArbitrumFoundation/scm-vetter-wallet
DZGoldman Aug 15, 2023
22d763e
fix first cohort
DZGoldman Aug 15, 2023
2adb802
add sc election proposal description
DZGoldman Aug 15, 2023
d449490
Update scripts/proposals/AIPX/generateProposalData.ts
DZGoldman Aug 15, 2023
f7c31dc
fix SecurityCouncilMemberRemovalGovernor comment
DZGoldman Aug 15, 2023
f09ae22
update snapshot
DZGoldman Aug 15, 2023
20d483a
Merge pull request #196 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 15, 2023
65dcbc3
config env vars in mainnet.ts
DZGoldman Aug 15, 2023
ad847d9
fix upgradeExecutor chain verification
DZGoldman Aug 15, 2023
fdf138c
mainnet deployment json
DZGoldman Aug 15, 2023
c933573
Merge pull request #195 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 15, 2023
45ee2b3
Merge branch 'security-council-mgmt--base' into security-council-mgmt…
DZGoldman Aug 15, 2023
bc4ccfe
generate proposal data json
DZGoldman Aug 15, 2023
4befeba
Fix snapshot
yahgwai Aug 16, 2023
c63744a
Merge branch 'security-council-mgmt--base' into security-council-mgmt…
yahgwai Aug 16, 2023
6f8f412
use /tree in github link in proposal description
DZGoldman Aug 16, 2023
0e62898
Set immutable constitution hash, and renamed text to aip 5
yahgwai Aug 16, 2023
5fa7d26
Renamed dir structure
yahgwai Aug 16, 2023
cda138a
Formatting
yahgwai Aug 16, 2023
bf96988
Updated snapshot
yahgwai Aug 16, 2023
de17a8a
redeploy arbOne activation
godzillaba Aug 16, 2023
9e2e4cd
Updated gas snapshot
yahgwai Aug 16, 2023
d61af72
Updated proposal data
yahgwai Aug 16, 2023
949b303
Merge pull request #198 from ArbitrumFoundation/security-council-mgmt…
DZGoldman Aug 16, 2023
7152b87
update commit hash in proposal description
DZGoldman Aug 16, 2023
c352bc7
Rename to aip 6
yahgwai Aug 17, 2023
c9e7c7e
Merge pull request #200 from ArbitrumFoundation/scm-aip6-rename
DZGoldman Aug 17, 2023
54af24e
Merge branch 'main' into security-council-mgmt--base: fix makefile co…
DZGoldman Aug 23, 2023
7edec60
Merge branch 'main' into security-council-mgmt--base
DZGoldman Aug 23, 2023
5441036
Merge branch 'main' into security-council-mgmt--base
DZGoldman Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
307 changes: 201 additions & 106 deletions .gas-snapshot

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ jobs:
- name: Run tests
run: make test

test-contract-size:
name: Test contract size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install packages
run: yarn

- name: Run build --sizes
run: FOUNDRY_PROFILE=sec_council_mgmt forge build --sizes

test-gas:
name: Test gas
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dist/
report/
lcov.info
lcov.info.pruned
proposalState.json
types/
proposalState.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
path = token-bridge-contracts
url = https://github.com/OffchainLabs/token-bridge-contracts.git
branch = reverse-bridge-2
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/Vectorized/solady
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ install :; yarn
build :; forge build
coverage :; forge coverage
gas :; forge test --gas-report
gas-check :; forge snapshot --check
gas-check :; forge snapshot --check --tolerance 1
snapshot :; forge snapshot
test-unit :; forge test -vvv
clean :; forge clean
fmt :; forge fmt
gen-network :; yarn gen:network
test : test-unit
test-integration :; yarn test:integration
test-action-storage :; ./scripts/test-action-storage.sh
sc-election-test :; FOUNDRY_MATCH_PATH='test/security-council-mgmt/**/*.t.sol' make test
test-integration :; yarn test:integration

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ This project contains smart contracts for Arbitrum token and governance. Please
* [Overview](./docs/overview.md)
* [Proposal lifecycle](./docs/proposal_lifecycle_example.md)
* [Governance Action Contracts](./src/gov-action-contracts/README.md)
* [Security Council Elections](./docs/security-council-mgmt.md)
* [Security Audit](./audits/trail_of_bits_governance_report_1_6_2023.pdf)
* [Gotchas](./docs/gotchas.md)
* [Proposal Monitor](./docs/proposalMonitor.md)
Expand Down
Binary file not shown.
9 changes: 5 additions & 4 deletions docs/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ There are two L1 proxy admins - one for the governance contracts, once for the g
In the both treasury timelock and the DAO treasury can be transfered via treasury gov DAO vote; however, only ARB in the DAO treasury is excluded from the quorum numerator calculation. Thus, the DAO’s ARB should ideally all be stored in the DAO Treasury. (Currently, the sweepReceiver in the TokenDistributor is set to the timelock, not the DAO treasury.)
- **L2ArbitrumGovernoer onlyGovernance behavior**
Typically, for a timelocked OZ governror, the `onlyGovernance` modifier ensures a call is made from the timelock; in L2ArbitrumGoverner, the _executor() method is overriden such that `onlyGovernance` enforces a call from the governor contract itself. This ensures calls guarded by `onlyGovernance` go through the full core proposal path, as calls from the governor could only be sent via `relay`. See the code comment on `relay` in [L2ArbitrumGoveror](../src/L2ArbitrumGovernor.sol) for more.
- **L2 Proposal Cancelation**
There are two redundant affordances that the security council can use to cancel proposals in the L2 timelock: relaying through core governor, or using its `CANCELLER_ROLE` affordance. Additionally, the later affordances is granted directly to the security council, not the `UpgradeExecutor` (this is inconsistent with how `UpgradeExecutors` are generally used elsewhere.)
- **L1 Proposal Cancelation**
The Security Council — not the L1 `UpgradeExecutor` — has the affordance to cancel proposals in the L1 timelock, inconsistent with how `UpgradeExecutors` are generally used elsewhere.

- The `UpgradeExecRouteBuilder` contract is immutable; instead of upgrading it, it can be redeployed, in which case any references to its address should be updated as well (currently only referenced in SecurityCouncilManager).
- The `UpgradeExecRouteBuilder`'s l1TimelockMinDelay variable should be equal to the minimum timelock delay on the core L1 timelock. If, for whatever reason, the value on the L1 timelock is ever increased, the UpgradeExecRouteBuilder should be redeployed with the new value accordingly.
- Changes to members of the security council should be initiated via the SecurityCouncilManager, not via calling addOwner/removeOwner on the multisigs directly. This ensures that the security council's two cohorts remain properly tracked.
- Voting abstain on a SecurityCouncilMemberRemovalGovernor proposal is disallowed.
1 change: 0 additions & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ You can read more about how the path is encoded in the [proposal lifecycle docum
Both governor contracts have the affordance to cancel proposals scheduled in the L2 Timelock. The Security Council can likewise cancel proposals [via calling L2ArbitrumGovernor.relay](src/gov-action-contracts/governance/CancelTimelockOperation.sol). Note that although the core-governor Security Council has the affordance to cancel proposals in the L2 timelock via calling `cancel` directly, for clarity and consistency, it should use the aforementioned `relay` method.

## Future DAO-Governed Chains

When a [new L2 chain is authorized by the DAO](https://docs.arbitrum.foundation/new-arb-chains), the following steps should be carried out for the new chain to become DAO-governed:
1. Deploy a new UpgradeExecutor contract and a new Security Council on the new L2 chain.
1. Initialize the new L2 UpgradeExectutor with the L1 Timelock's aliased addressed and the new Security Council as its executors.
Expand Down
Binary file added docs/security-council-colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/security-council-election-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions docs/security-council-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Security Council Manager as a source of truth

The Security Council Manager is the source of truth for the membership of all Security Councils on all chains where they are deployed. It contains a registered list of Security Councils, which it will update with any changes to membership.

All changes to membership should be made through the manager, which will then propagate these changes to the councils. Any changes made directly to the councils will be overwritten the next time the Manager pushes an update. As a reminder the normal flow for an election is:
- **SecurityCouncilNomineeElectionGovernor.createElection** - called at T+0 where T is a multiple of 6 months after the first election date
- **SecurityCouncilNomineeElectionGovernor.execute** - called at T+21 days
- **SecurityCouncilMemberElectionGovernor.execute** - called at T + 42 days
- **ArbitrumTimelock.execute** (on L2) - called at T + 42 days
- **Outbox.executeTransaction** - called at T + 49 days
- **L1ArbitrumTimelock.executeBatch** - called at T + 52 days
- Retryable ticket execution on ArbOne and Nova - also called at T + 52 days


## Public functions

### Replace cohort

Can only be called by the Member Election Governor. It is used to replace a whole cohort of (6) members. This is the function that will be called for the standard elections that take place every 6 months.

### Remove member

Can be called by the Emergency Security Council and the Removal Governor. Is used to remove a member. The Constitution allows members to be removed if 9 of 12 members wish them to be, or if the DAO votes to remove a member and 10% of votable tokens cast a vote, with 5/6 of voted tokens are in favour of removal.

### Add member

Can only be called by the Emergency Security Council. Can only be called if the there are less than 12 members in the Security Council because at least one has been removed.

### Replace member

Can only be called by the Emergency Security Council. This is a utility function to allow the council to call Remove and Add in the same transaction. Semantically this means that an entity has been removed from the council, and a different one has been added.

### Rotate member

Can only be called by the Emergency Security Council. Functionally this is the same as Replace, however semantically it infers different intent. Rotate should be called when a entity wish to replace their address, but it is the same entity that controls the newly added address.

### Add Security Council

Can be called by DAO and the emergency security council. Adds an additional security council whose members will be updated by the election system.

### Remove Security Council

Can be called by DAO and the emergency security council. Removes a security council from being updated by the election system.


## Race conditions
Since the Security Council Manager can be updated from a number of sources race conditions can occur in the updates. Some of these updates are long lived processes (the elections), so care must be taking to avoid these kinds of race conditions.

Below we'll explain the possible sources of races, and how they're mitigated.

### Standard elections
Standard elections take place every 6 months, and last 42 days before replacing the cohort in the Manager. The election governors do checks to ensure that a contender will not become a member of both cohorts, and this is then later enforced in Manager. However, whilst the elections are ongoing the membership in the Manager may be manipulated causing the result of the election to conflict (eg by adding a potential nominee to the previous cohort in the manager). This would cause the election execution to revert.

The election contracts deal with this situation by essentially pausing the election pipeline until it is "unblocked". The election result will wait as an unexecuted proposal in the Member Election Governor; the Nominee Selection Governor will not allow the next election to be created until the previous proposal has executed, therefore meaning that no election results can be propagated to the Manager until the conflict is resolved.

Since the conflict can only have been created by adding an individual member - something only the Security Council can do - it is then expected that the Security Council should unblock the pipeline by removing the member they added and allowing the election to complete. Therefore should the Security Council call the `rotateMember`, `replaceMember` or `addMember` methods they should ensure that they do not do so for accounts that are contenders or nominees in an ongoing election. In particular:

> If an address is being added to the previous cohort whilst an election is ongoing it must not be the same as any of the contenders or nominees in that election
### Removal elections
Elections occuring in the Removal Governor will result in a member being removed. However it could be that by the time the proposal to remove the member completes the member has already been removed by some other means. In this case the removal proposal will block, being unable to execute.

To address this an expiry has been added to Succeeded removal proposals, such that if a successful removal proposal has not been executed within the expiry period it will transition into an Expired state and will not be able to be executed at a later date. The execute function can be called by anyone, so someone should ensure that this is called on a successful proposal before it expires.

### Propagation races
After an update occurs in the Manager it is propagated to all registered Security Councils. This propagation goes through a number of steps, including timelocks, withdrawals and potentially retryable transactions. Each of these stages can be executed by anyone, however if one these stages wasn't executed then the update might remain waiting at one of the stages. It's possible that at this point another update could overtake a previous one, the final execution of the updates might then occur out of order.

To mitigate this the Member Sync Action contract which is the last step in updating the membership on the Security Council Gnosis Safe uses a key value store to store an ordered update nonce that ensure no later update can be made before an earlier one.
Loading