Skip to content

Commit bf5dc65

Browse files
cyberphysic4lalexsporn
authored andcommitted
iota-rest-api changes
1 parent ae7ff19 commit bf5dc65

File tree

2 files changed

+87
-5
lines changed

2 files changed

+87
-5
lines changed

crates/iota-rest-api/openapi/openapi.json

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,76 @@
19221922
}
19231923
}
19241924
},
1925+
{
1926+
"type": "object",
1927+
"required": [
1928+
"computation_charge",
1929+
"computation_charge_burned",
1930+
"epoch",
1931+
"epoch_start_timestamp_ms",
1932+
"kind",
1933+
"non_refundable_storage_fee",
1934+
"protocol_version",
1935+
"storage_charge",
1936+
"storage_rebate",
1937+
"system_packages"
1938+
],
1939+
"properties": {
1940+
"computation_charge": {
1941+
"description": "The total amount of gas charged for computation during the epoch.",
1942+
"type": "string",
1943+
"format": "u64"
1944+
},
1945+
"computation_charge_burned": {
1946+
"description": "The total amount of gas burned for computation during the epoch.",
1947+
"type": "string",
1948+
"format": "u64"
1949+
},
1950+
"epoch": {
1951+
"description": "The next (to become) epoch ID.",
1952+
"type": "string",
1953+
"format": "u64"
1954+
},
1955+
"epoch_start_timestamp_ms": {
1956+
"description": "Unix timestamp when epoch started",
1957+
"type": "string",
1958+
"format": "u64"
1959+
},
1960+
"kind": {
1961+
"type": "string",
1962+
"enum": [
1963+
"change_epoch_v2"
1964+
]
1965+
},
1966+
"non_refundable_storage_fee": {
1967+
"description": "The non-refundable storage fee.",
1968+
"type": "string",
1969+
"format": "u64"
1970+
},
1971+
"protocol_version": {
1972+
"description": "The protocol version in effect in the new epoch.",
1973+
"type": "string",
1974+
"format": "u64"
1975+
},
1976+
"storage_charge": {
1977+
"description": "The total amount of gas charged for storage during the epoch.",
1978+
"type": "string",
1979+
"format": "u64"
1980+
},
1981+
"storage_rebate": {
1982+
"description": "The amount of storage rebate refunded to the txn senders.",
1983+
"type": "string",
1984+
"format": "u64"
1985+
},
1986+
"system_packages": {
1987+
"description": "System packages (specifically framework and move stdlib) that are written before the new epoch starts. This tracks framework upgrades on chain. When executing the ChangeEpoch txn, the validator must write out the modules below. Modules are provided with the version they will be upgraded to, their modules in serialized form (which include their package ID), and a list of their transitive dependencies.",
1988+
"type": "array",
1989+
"items": {
1990+
"$ref": "#/components/schemas/SystemPackage"
1991+
}
1992+
}
1993+
}
1994+
},
19251995
{
19261996
"type": "object",
19271997
"required": [
@@ -3918,7 +3988,8 @@
39183988
"protocol_version",
39193989
"reference_gas_price",
39203990
"safe_mode",
3921-
"safe_mode_computation_rewards",
3991+
"safe_mode_computation_charges",
3992+
"safe_mode_computation_charges_burned",
39223993
"safe_mode_non_refundable_storage_fee",
39233994
"safe_mode_storage_charges",
39243995
"safe_mode_storage_rebates",
@@ -4054,11 +4125,16 @@
40544125
"description": "Whether the system is running in a downgraded safe mode due to a non-recoverable bug. This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. It can be reset once we are able to successfully execute advance_epoch.",
40554126
"type": "boolean"
40564127
},
4057-
"safe_mode_computation_rewards": {
4128+
"safe_mode_computation_charges": {
40584129
"description": "Amount of computation rewards accumulated (and not yet distributed) during safe mode.",
40594130
"type": "string",
40604131
"format": "u64"
40614132
},
4133+
"safe_mode_computation_charges_burned": {
4134+
"description": "Amount of burned computation rewards accumulated during safe mode.",
4135+
"type": "string",
4136+
"format": "u64"
4137+
},
40624138
"safe_mode_non_refundable_storage_fee": {
40634139
"description": "Amount of non-refundable storage fee accumulated during safe mode.",
40644140
"type": "string",

crates/iota-rest-api/src/system.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ pub struct SystemStateSummary {
121121
/// during safe mode.
122122
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
123123
#[schemars(with = "crate::_schemars::U64")]
124-
pub safe_mode_computation_rewards: u64,
124+
pub safe_mode_computation_charges: u64,
125+
/// Amount of burned computation rewards accumulated during safe mode.
126+
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
127+
#[schemars(with = "crate::_schemars::U64")]
128+
pub safe_mode_computation_charges_burned: u64,
125129
/// Amount of storage rebates accumulated (and not yet burned) during safe
126130
/// mode.
127131
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
@@ -443,7 +447,8 @@ impl From<iota_types::iota_system_state::iota_system_state_summary::IotaSystemSt
443447
reference_gas_price,
444448
safe_mode,
445449
safe_mode_storage_charges,
446-
safe_mode_computation_rewards,
450+
safe_mode_computation_charges,
451+
safe_mode_computation_charges_burned,
447452
safe_mode_storage_rebates,
448453
safe_mode_non_refundable_storage_fee,
449454
epoch_start_timestamp_ms,
@@ -480,7 +485,8 @@ impl From<iota_types::iota_system_state::iota_system_state_summary::IotaSystemSt
480485
reference_gas_price,
481486
safe_mode,
482487
safe_mode_storage_charges,
483-
safe_mode_computation_rewards,
488+
safe_mode_computation_charges,
489+
safe_mode_computation_charges_burned,
484490
safe_mode_storage_rebates,
485491
safe_mode_non_refundable_storage_fee,
486492
epoch_start_timestamp_ms,

0 commit comments

Comments
 (0)