From f387a33c240396b75b954670b908343af57f6710 Mon Sep 17 00:00:00 2001 From: brentstone Date: Fri, 27 Dec 2024 14:58:06 -0800 Subject: [PATCH 1/4] increase `MAX_PGF_ACTIONS` --- crates/governance/src/vp/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/governance/src/vp/mod.rs b/crates/governance/src/vp/mod.rs index 45e13a12e1..eb4adc6b57 100644 --- a/crates/governance/src/vp/mod.rs +++ b/crates/governance/src/vp/mod.rs @@ -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)] @@ -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() ))); } From c0131b77e647842b70d223d93a3ed3f21ef452fa Mon Sep 17 00:00:00 2001 From: brentstone Date: Fri, 27 Dec 2024 15:00:02 -0800 Subject: [PATCH 2/4] changelog: add #4209 --- .../unreleased/improvements/4209-increase-max-pgf-actions.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/improvements/4209-increase-max-pgf-actions.md diff --git a/.changelog/unreleased/improvements/4209-increase-max-pgf-actions.md b/.changelog/unreleased/improvements/4209-increase-max-pgf-actions.md new file mode 100644 index 0000000000..18e724fa70 --- /dev/null +++ b/.changelog/unreleased/improvements/4209-increase-max-pgf-actions.md @@ -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)) \ No newline at end of file From 790a958e32780db5bc0555d1ea06b1a7b459557c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Fri, 3 Jan 2025 13:35:00 +0000 Subject: [PATCH 3/4] TEMP: try to run 10k ibc transfers in PGF --- crates/governance/src/finalize_block.rs | 41 +++++++++++++++---------- crates/tests/src/e2e/ibc_tests.rs | 2 +- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/crates/governance/src/finalize_block.rs b/crates/governance/src/finalize_block.rs index 6dc6b8d012..0e5405c48c 100644 --- a/crates/governance/src/finalize_block.rs +++ b/crates/governance/src/finalize_block.rs @@ -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 { diff --git a/crates/tests/src/e2e/ibc_tests.rs b/crates/tests/src/e2e/ibc_tests.rs index c4c09694cc..76994a8880 100644 --- a/crates/tests/src/e2e/ibc_tests.rs +++ b/crates/tests/src/e2e/ibc_tests.rs @@ -652,7 +652,7 @@ fn pgf_over_ibc() -> Result<()> { ALBERT, PGF_ADDRESS.to_string(), NAM, - 100, + 10_000_000, ALBERT_KEY, &[], )?; From c413db607ae9335705d31c409ae2c71b662e1cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Fri, 3 Jan 2025 13:55:01 +0000 Subject: [PATCH 4/4] fixup! TEMP: try to run 10k ibc transfers in PGF --- crates/tests/src/e2e/ibc_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/tests/src/e2e/ibc_tests.rs b/crates/tests/src/e2e/ibc_tests.rs index 76994a8880..c2c12de9df 100644 --- a/crates/tests/src/e2e/ibc_tests.rs +++ b/crates/tests/src/e2e/ibc_tests.rs @@ -652,7 +652,7 @@ fn pgf_over_ibc() -> Result<()> { ALBERT, PGF_ADDRESS.to_string(), NAM, - 10_000_000, + 1_000_000, ALBERT_KEY, &[], )?; @@ -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(()) }