diff --git a/crates/iota-framework/docs/iota-system/iota_system_state_inner.mdx b/crates/iota-framework/docs/iota-system/iota_system_state_inner.mdx index 431f53f66e7..232472f96a8 100644 --- a/crates/iota-framework/docs/iota-system/iota_system_state_inner.mdx +++ b/crates/iota-framework/docs/iota-system/iota_system_state_inner.mdx @@ -635,13 +635,6 @@ total_stake: u64
-storage_fund_reinvestment: u64
-
@@ -2389,8 +2382,6 @@ or smaller than the computation reward.
reference_gas_price: self.reference_gas_price,
total_stake: new_total_stake,
storage_charge: storage_charge_value,
- // TODO: remove(obsolete)
- storage_fund_reinvestment: 0,
storage_rebate: storage_rebate_amount,
storage_fund_balance: self.storage_fund.total_balance(),
// TODO: remove(obsolete)
diff --git a/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move b/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move
index 4cbaec1a951..23eb13034d5 100644
--- a/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move
+++ b/crates/iota-framework/packages/iota-system/sources/iota_system_state_inner.move
@@ -207,7 +207,6 @@ module iota_system::iota_system_state_inner {
protocol_version: u64,
reference_gas_price: u64,
total_stake: u64,
- storage_fund_reinvestment: u64,
storage_charge: u64,
storage_rebate: u64,
storage_fund_balance: u64,
@@ -932,8 +931,6 @@ module iota_system::iota_system_state_inner {
reference_gas_price: self.reference_gas_price,
total_stake: new_total_stake,
storage_charge: storage_charge_value,
- // TODO: remove(obsolete)
- storage_fund_reinvestment: 0,
storage_rebate: storage_rebate_amount,
storage_fund_balance: self.storage_fund.total_balance(),
// TODO: remove(obsolete)
diff --git a/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/down.sql b/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/down.sql
new file mode 100644
index 00000000000..7eac15bd645
--- /dev/null
+++ b/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/down.sql
@@ -0,0 +1 @@
+ALTER TABLE epochs ADD COLUMN storage_fund_reinvestment BIGINT;
diff --git a/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/up.sql b/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/up.sql
new file mode 100644
index 00000000000..b48369d9054
--- /dev/null
+++ b/crates/iota-indexer/migrations/2024-07-23-075345_remove_reinvestment/up.sql
@@ -0,0 +1 @@
+ALTER TABLE epochs DROP COLUMN storage_fund_reinvestment;
diff --git a/crates/iota-indexer/src/models/epoch.rs b/crates/iota-indexer/src/models/epoch.rs
index ce5eff58192..5e0c0cd7916 100644
--- a/crates/iota-indexer/src/models/epoch.rs
+++ b/crates/iota-indexer/src/models/epoch.rs
@@ -22,8 +22,6 @@ pub struct StoredEpochInfo {
pub epoch_total_transactions: Option,
pub last_checkpoint_id: Option,
pub epoch_end_timestamp: Option,
- // TODO: remove(obsolete)
- pub storage_fund_reinvestment: Option,
pub storage_charge: Option,
pub storage_rebate: Option,
// TODO: remove(obsolete)
@@ -49,8 +47,6 @@ pub struct QueryableEpochInfo {
pub epoch_total_transactions: Option,
pub last_checkpoint_id: Option,
pub epoch_end_timestamp: Option,
- // TODO: remove(obsolete)
- pub storage_fund_reinvestment: Option,
pub storage_charge: Option,
pub storage_rebate: Option,
// TODO: remove(obsolete)
@@ -90,7 +86,6 @@ impl StoredEpochInfo {
epoch_total_transactions: e.epoch_total_transactions.map(|v| v as i64),
last_checkpoint_id: e.last_checkpoint_id.map(|v| v as i64),
epoch_end_timestamp: e.epoch_end_timestamp.map(|v| v as i64),
- storage_fund_reinvestment: e.storage_fund_reinvestment.map(|v| v as i64),
storage_charge: e.storage_charge.map(|v| v as i64),
storage_rebate: e.storage_rebate.map(|v| v as i64),
stake_subsidy_amount: e.stake_subsidy_amount.map(|v| v as i64),
@@ -127,7 +122,6 @@ impl From<&StoredEpochInfo> for Option {
total_stake: info.total_stake as u64,
storage_fund_balance: info.storage_fund_balance as u64,
epoch_end_timestamp: info.epoch_end_timestamp.map(|v| v as u64)?,
- storage_fund_reinvestment: info.storage_fund_reinvestment.map(|v| v as u64)?,
storage_charge: info.storage_charge.map(|v| v as u64)?,
storage_rebate: info.storage_rebate.map(|v| v as u64)?,
stake_subsidy_amount: info.stake_subsidy_amount.map(|v| v as u64)?,
diff --git a/crates/iota-indexer/src/schema.rs b/crates/iota-indexer/src/schema.rs
index ff039f12821..fc0f1aaa0f8 100644
--- a/crates/iota-indexer/src/schema.rs
+++ b/crates/iota-indexer/src/schema.rs
@@ -46,7 +46,6 @@ diesel::table! {
epoch_total_transactions -> Nullable,
last_checkpoint_id -> Nullable,
epoch_end_timestamp -> Nullable,
- storage_fund_reinvestment -> Nullable,
storage_charge -> Nullable,
storage_rebate -> Nullable,
stake_subsidy_amount -> Nullable,
diff --git a/crates/iota-indexer/src/store/pg_indexer_store.rs b/crates/iota-indexer/src/store/pg_indexer_store.rs
index 03f933336bc..b0091ae8744 100644
--- a/crates/iota-indexer/src/store/pg_indexer_store.rs
+++ b/crates/iota-indexer/src/store/pg_indexer_store.rs
@@ -721,8 +721,6 @@ impl PgIndexerStore {
.eq(excluded(epochs::epoch_total_transactions)),
epochs::last_checkpoint_id.eq(excluded(epochs::last_checkpoint_id)),
epochs::epoch_end_timestamp.eq(excluded(epochs::epoch_end_timestamp)),
- epochs::storage_fund_reinvestment
- .eq(excluded(epochs::storage_fund_reinvestment)),
epochs::storage_charge.eq(excluded(epochs::storage_charge)),
epochs::storage_rebate.eq(excluded(epochs::storage_rebate)),
epochs::stake_subsidy_amount.eq(excluded(epochs::stake_subsidy_amount)),
diff --git a/crates/iota-indexer/src/types.rs b/crates/iota-indexer/src/types.rs
index 9243977d711..7efe63a4c99 100644
--- a/crates/iota-indexer/src/types.rs
+++ b/crates/iota-indexer/src/types.rs
@@ -98,8 +98,6 @@ pub struct IndexedEpochInfo {
pub epoch_total_transactions: Option,
pub last_checkpoint_id: Option,
pub epoch_end_timestamp: Option,
- // TODO: remove(obsolete)
- pub storage_fund_reinvestment: Option,
pub storage_charge: Option,
pub storage_rebate: Option,
// TODO: remove(obsolete)
@@ -148,7 +146,6 @@ impl IndexedEpochInfo {
),
last_checkpoint_id: Some(*last_checkpoint_summary.sequence_number()),
epoch_end_timestamp: Some(last_checkpoint_summary.timestamp_ms),
- storage_fund_reinvestment: Some(event.storage_fund_reinvestment),
storage_charge: Some(event.storage_charge),
storage_rebate: Some(event.storage_rebate),
burnt_leftover_amount: Some(event.burnt_leftover_amount),
diff --git a/crates/iota-json-rpc-types/src/iota_extended.rs b/crates/iota-json-rpc-types/src/iota_extended.rs
index 72dfbc4ef56..bf4e440d6b9 100644
--- a/crates/iota-json-rpc-types/src/iota_extended.rs
+++ b/crates/iota-json-rpc-types/src/iota_extended.rs
@@ -79,9 +79,6 @@ pub struct EndOfEpochInfo {
pub total_stake: u64,
#[schemars(with = "BigInt")]
#[serde_as(as = "BigInt")]
- pub storage_fund_reinvestment: u64,
- #[schemars(with = "BigInt")]
- #[serde_as(as = "BigInt")]
pub storage_charge: u64,
#[schemars(with = "BigInt")]
#[serde_as(as = "BigInt")]
diff --git a/crates/iota-protocol-config/src/lib.rs b/crates/iota-protocol-config/src/lib.rs
index bec5c39dd91..ba7701d61c2 100644
--- a/crates/iota-protocol-config/src/lib.rs
+++ b/crates/iota-protocol-config/src/lib.rs
@@ -648,10 +648,6 @@ pub struct ProtocolConfig {
/// storage rebate back. In basis point.
storage_rebate_rate: Option,
- /// 5% of the storage fund's share of rewards are reinvested into the
- /// storage fund. In basis point.
- storage_fund_reinvest_rate: Option,
-
/// The share of rewards that will be slashed and redistributed is 50%.
/// In basis point.
reward_slashing_rate: Option,
@@ -1362,7 +1358,6 @@ impl ProtocolConfig {
obj_metadata_cost_non_refundable: Some(50),
gas_model_version: Some(8),
storage_rebate_rate: Some(10000),
- storage_fund_reinvest_rate: Some(0),
// Change reward slashing rate to 100%.
reward_slashing_rate: Some(10000),
storage_gas_price: Some(76),
diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap
index 314e4a500c1..be010860a40 100644
--- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap
+++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap
@@ -120,7 +120,6 @@ gas_model_version: 8
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
-storage_fund_reinvest_rate: 0
reward_slashing_rate: 10000
storage_gas_price: 76
validator_target_reward: 767000000000000
diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap
index de4fcafe1b1..0e0b795d29d 100644
--- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap
+++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap
@@ -122,7 +122,6 @@ gas_model_version: 8
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
-storage_fund_reinvest_rate: 0
reward_slashing_rate: 10000
storage_gas_price: 76
validator_target_reward: 767000000000000
diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap
index cdf28b54fef..2fe129ab283 100644
--- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap
+++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap
@@ -125,7 +125,6 @@ gas_model_version: 8
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
-storage_fund_reinvest_rate: 0
reward_slashing_rate: 10000
storage_gas_price: 76
validator_target_reward: 767000000000000
diff --git a/crates/iota-types/src/event.rs b/crates/iota-types/src/event.rs
index aa90d2f2e6b..dc48d3eb8c9 100755
--- a/crates/iota-types/src/event.rs
+++ b/crates/iota-types/src/event.rs
@@ -169,8 +169,6 @@ pub struct SystemEpochInfoEvent {
pub protocol_version: u64,
pub reference_gas_price: u64,
pub total_stake: u64,
- // TODO: remove(obsolete)
- pub storage_fund_reinvestment: u64,
pub storage_charge: u64,
pub storage_rebate: u64,
pub storage_fund_balance: u64,
diff --git a/crates/iota-types/src/iota_system_state/iota_system_state_summary.rs b/crates/iota-types/src/iota_system_state/iota_system_state_summary.rs
index 3b42b594781..72cd0c50b87 100644
--- a/crates/iota-types/src/iota_system_state/iota_system_state_summary.rs
+++ b/crates/iota-types/src/iota_system_state/iota_system_state_summary.rs
@@ -51,8 +51,8 @@ pub struct IotaSystemStateSummary {
#[schemars(with = "BigInt")]
#[serde_as(as = "Readable, _>")]
pub storage_fund_total_object_storage_rebates: u64,
- /// The non-refundable portion of the storage fund coming from storage
- /// reinvestment, non-refundable storage rebates and any leftover
+ /// The non-refundable portion of the storage fund coming from
+ /// non-refundable storage rebates and any leftover
/// staking rewards.
#[schemars(with = "BigInt")]
#[serde_as(as = "Readable, _>")]