-
Notifications
You must be signed in to change notification settings - Fork 3
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
Hardcoded PoA admin #21
Comments
@fmorency This is specifically for testnet vs mainnet overrides. For mainnet, the main address (multisig) from the team will be used. But if a testnet (like we are doing now is to be used), we want to have an override option for this. Technically I could get the POA array[0], but this does not seem intuitive vs a clear override needed, which is in the testnet summary here (#15). Since this only affects testnet, and can be removed for mainnet, it does not really make sense to document vs the confusion that would add. So this only affects us not the broader network. |
Thank you for the clarification, @Reecepbcups! It is fine at this stage, but the hardcoded return should be changed before officially releasing the chain. Let's keep track of this issue here. |
@Reecepbcups Related to this issue, I am starting a new node with POA_ADMIN_ADDRESS=manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct CHAIN_ID="local-1" HOME_DIR="~/.manifest3" TIMEOUT_COMMIT="2000ms" CLEAN=true sh scripts/test_node.sh where
always returns the same PoA Admin no matter what I put in params:
admins:
- manifest10d07y265gmmuvt4z0w9aw880jnsr700jmq3jzm
allow_validator_self_exit: true I can reproduce it on a freshly cloned repository. Are you able to reproduce? Note: The issue doesn't appear to affect functionality, i.e., I am able to execute PoA admin tx with |
@fmorency Correct, the POA admins param and POA_ADMIN_ADDRESS is the authority for all cosmos sdk modules (the one you set) and one is for controlling the POA module itself. I probably should have named it manifest10d07y265gmmuvt4z0w9aw880jnsr700jmq3jzm is found in the |
I'm writing tests using an Some observations for the sake of posterity
While the POA_ADMIN_ADDRESS is the authority for all SDK modules, it is NOT the authority of the POA module itself (unless specified). The POA module Admin field is the authority of the POA module. |
I'm working on wiring the simulator to the manifest module and found a case related to this issue. The SDK module authority is hardcoded through the Thoughts @Reecepbcups? |
As a workaround, I can set r := rand.New(rand.NewSource(config.Seed))
params := simulation.RandomParams(r)
accs := simulationtypes.RandomAccounts(r, params.NumKeys())
poaAdminAddr := accs[0]
err = os.Setenv("POA_ADMIN_ADDRESS", poaAdminAddr.Address.String())
...
// The SDK module address is set in `NewApp`.
bApp := app.NewApp(...) where I don't like it much but it'll do in the meantime. |
* liftedinit/manifest-ledger#21 * refactor: only use authority as admin (no params) * fix: re-add old param even though it is removed * refactor: remove params entirely * wip: testing * rm gov test which is no longer required * modify simulation * remove poa params e2e * fix: depinject issue with authority * depinject 1.0.0 * lint * Err -> idx 5 * single authority for depinject * so stick of sim testing whatever get in hardcoded w/ admin bypass * fix unit test * lint * fix: dont init() bypass * fix: codec * lint
Should update to POA commit d321226154bed00f78e90f3c19fef0539d5e707c for a single authority. Removes need for genesis admin params as well from testnet, e2e, etc can also remove the entire GetPoAAdmin() function. Env |
Thanks @Reecepbcups. I will make the modifications! |
In
app.go
, theGetPoAAdmin()
function isWe should remove the hardcoded address.
I discovered this while trying to test a local chain using
local-ic
and the following genesis fileI expected
manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct
to be the single PoA Admin without having to set thePOA_ADMIN_ADDRESS
environment variable. Executingmanifestd --chain-id manifest-2 --keyring-backend os --node tcp://localhost:40531 tx manifest update-params manifest1efd63aw40lxf3n4mhf7dzhjkr453axurm6rp3z:50_000_000,manifest17dh4tstgw4s30ht4lfuc2l6gccqkzttxylw8kq:25_000_000,manifest1gp33pgpx78j7lgjm4422tp80uaxseap6m8fd6s:25_000_000 false 0umfx --from acc0
led to
which was unexpected.
Why can't we initialize the list of PoA Admins from the genesis file and need the
POA_ADMIN_ADDRESS
environment variable?The
POA_ADMIN_ADDRESS
use is also undocumented in #18.The text was updated successfully, but these errors were encountered: