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

TEMP - don't merge #4216

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Increase the allowed number of PGF targets in a single proposal from 20 to
1000. ([\#4209](https://github.com/anoma/namada/pull/4209))
41 changes: 24 additions & 17 deletions crates/governance/src/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,26 +500,33 @@ where
result
}
PGFTarget::Ibc(target) => {
let result = transfer_over_ibc(
storage,
token,
&PGF_ADDRESS,
target,
);
if result.is_ok() {
Token::emit_transfer_event(
for i in 0..10_000 {
let result = transfer_over_ibc(
storage,
"pgf-payments-over-ibc".into(),
EventLevel::Block,
token,
target.amount,
token::UserAccount::Internal(PGF_ADDRESS),
token::UserAccount::External(
target.target.clone(),
),
)?;
&PGF_ADDRESS,
target,
);
tracing::info!(
"IBC PGF transfer {i}, is success: {}",
result.is_ok()
);
if result.is_ok() {
Token::emit_transfer_event(
storage,
"pgf-payments-over-ibc".into(),
EventLevel::Block,
token,
target.amount,
token::UserAccount::Internal(PGF_ADDRESS),
token::UserAccount::External(
target.target.clone(),
),
)?;
}
result?
}
result
Ok(())
}
};
match result {
Expand Down
7 changes: 4 additions & 3 deletions crates/governance/src/vp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::ProposalVote;
pub const ADDRESS: Address = Address::Internal(InternalAddress::Governance);

/// The maximum number of item in a pgf proposal
pub const MAX_PGF_ACTIONS: usize = 20;
pub const MAX_PGF_ACTIONS: usize = 1000;

#[allow(missing_docs)]
#[derive(Error, Debug)]
Expand Down Expand Up @@ -505,8 +505,9 @@ where

if !is_total_fundings_valid {
return Err(Error::new_alloc(format!(
"Maximum number of funding actions \
({MAX_PGF_ACTIONS}) exceeded ({})",
"Maximum number of funding targets \
({MAX_PGF_ACTIONS}) exceeded by the provided amount \
of ({})",
fundings.len()
)));
}
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/src/e2e/ibc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ fn pgf_over_ibc() -> Result<()> {
ALBERT,
PGF_ADDRESS.to_string(),
NAM,
100,
1_000_000,
ALBERT_KEY,
&[],
)?;
Expand Down Expand Up @@ -694,7 +694,7 @@ fn pgf_over_ibc() -> Result<()> {
let token_addr = find_address(&test, NAM)?;
let ibc_denom = format!("{port_id_gaia}/{channel_id_gaia}/{token_addr}");
check_cosmos_balance(&test_gaia, COSMOS_RELAYER, &ibc_denom, 10_000_000)?;
check_cosmos_balance(&test_gaia, COSMOS_USER, &ibc_denom, 5_000_000)?;
check_cosmos_balance(&test_gaia, COSMOS_USER, &ibc_denom, 50_000_000_000)?;

Ok(())
}
Expand Down
Loading