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

feat: Staking reward generation through inflation #1052

Merged
merged 94 commits into from
Jul 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
bfa308f
feat: store IOTA's TreasutyCap in SystemObject
valeriyr Jul 2, 2024
9c887de
fix: Add `TreasuryCap` to Rust system inner types
PhilippGackstatter Jul 3, 2024
29ff60d
feat: Add minting and burning of IOTA tokens
PhilippGackstatter Jul 3, 2024
c68aab4
feat(iota-framework-snapshot): the framework snapshots were regenerated
valeriyr Jul 3, 2024
8510aee
Merge pull request #966 from iotaledger/sc-platform/issue-946-retain-…
valeriyr Jul 3, 2024
90f53ed
feat(iota-types): staking params were changed according new requirements
valeriyr Jul 2, 2024
8970dc4
feat: Fix tests and add target reward mint/burn tests
PhilippGackstatter Jul 3, 2024
c926dac
fix: Update docs
PhilippGackstatter Jul 3, 2024
92e4dbb
feat: Skip iota conservation check on epoch change
PhilippGackstatter Jul 3, 2024
6bc41c2
feat: Pass validator target reward param on epoch advance
PhilippGackstatter Jul 3, 2024
6179424
fix: Pass validator reward also in v0, v1, v2
PhilippGackstatter Jul 3, 2024
11ac9f5
feat: Temporarily disable authority conservation check
PhilippGackstatter Jul 3, 2024
c743734
Merge pull request #951 from iotaledger/sc-platform/issue-944-staking…
valeriyr Jul 3, 2024
512f0e5
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 3, 2024
4e1329b
feat: implemented IotaTreasuryCap
valeriyr Jul 3, 2024
694f138
feat: added tests checking IOTA creation processes
valeriyr Jul 3, 2024
3adb12e
feat: Make inflation/deflation tests more understandable
PhilippGackstatter Jul 3, 2024
7bce060
Merge pull request #974 from iotaledger/sc-platform/issue-941-iota-tr…
valeriyr Jul 3, 2024
3bd9d18
fix: Better comment on the target reward value
PhilippGackstatter Jul 3, 2024
76befe1
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 4, 2024
25ab220
feat: Use `IotaTreasuryCap` for minting and burning
PhilippGackstatter Jul 4, 2024
4dbe85d
feat(sc-platform): Disable stake subsidies (#992)
PhilippGackstatter Jul 4, 2024
aca9357
feat(iota-protocol-config): disabling storage_fund_reinvest_rate
Dkwcs Jul 4, 2024
d2abdb1
feat(iota-framework): burning leftover rewards, storage_fund doesn't …
Dkwcs Jul 4, 2024
1559226
feat(iota-framework): storage_fund_reward has been removed
Dkwcs Jul 4, 2024
119d36c
feat(iota-framework): storage_fund_reinvest_rate has been removed fro…
Dkwcs Jul 4, 2024
245e733
Merge pull request #1009 from iotaledger/sc-platform/disable-storage_…
valeriyr Jul 5, 2024
4d44b9b
fix: Use indentation of 4 everywhere
PhilippGackstatter Jul 5, 2024
ec62bc1
fix: Apply rustfmt
PhilippGackstatter Jul 5, 2024
25a8f8a
fix: Better name for minting/burning function
PhilippGackstatter Jul 5, 2024
ef45247
Merge pull request #1011 from iotaledger/sc-platform/burn-leftover_st…
valeriyr Jul 5, 2024
2506317
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 5, 2024
aca50ae
fix: Update protocol config snapshot
PhilippGackstatter Jul 5, 2024
1c5a4aa
Merge branch 'sc-platform/issue-153' into sc-platform/remove-storage_…
valeriyr Jul 5, 2024
83371ba
fix: Make mint/burn function private
PhilippGackstatter Jul 5, 2024
2ba9174
fix(iota-framework): typos
valeriyr Jul 5, 2024
d0d1540
fix(iota-framework): returned storage_fund_reinvestment into SystemEp…
valeriyr Jul 5, 2024
4ff876e
fix: Also update testnet and mainnet
PhilippGackstatter Jul 5, 2024
b05816d
fix(iota-framework): fixed delegation and reward distribution tests
valeriyr Jul 5, 2024
f230b8d
Merge pull request #1014 from iotaledger/sc-platform/remove-storage_f…
valeriyr Jul 8, 2024
cf701f2
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 8, 2024
c8ff3c1
feat: Update framework snapshot
PhilippGackstatter Jul 8, 2024
207b68b
Merge pull request #971 from iotaledger/sc-platform/945-mint-and-burn…
PhilippGackstatter Jul 8, 2024
8e496f0
feat: Add validator commission with staking test
PhilippGackstatter Jul 9, 2024
4ed4eb5
feat(iota-protocol-config): set storage_rebate_rate to 100% (#1071)
Dkwcs Jul 9, 2024
72dfb2b
feat: Add rewards test with minting & burning
PhilippGackstatter Jul 9, 2024
fd2235c
feat: Add timelocked minting & burning tests
PhilippGackstatter Jul 9, 2024
c6cb42a
fix: description of minting & burning tests
PhilippGackstatter Jul 9, 2024
96b8909
fix: indentation
PhilippGackstatter Jul 10, 2024
a33c237
fix(iota-framework/tests): add tests checking leftovers burning (#1098)
Dkwcs Jul 10, 2024
2421401
fix: Add comment on disabled stake subsidy fund
PhilippGackstatter Jul 10, 2024
1c4844f
feat: Make `get_total_iota_supply` fun public
PhilippGackstatter Jul 10, 2024
b4a201f
refactor: Rename computation reward to validator rewards
PhilippGackstatter Jul 10, 2024
4a3cbae
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 11, 2024
f56d0fc
feat: Add minting test with commission
PhilippGackstatter Jul 11, 2024
ffc56e1
Merge pull request #1081 from iotaledger/sc-platform/1061-inflation-t…
PhilippGackstatter Jul 11, 2024
983178d
fix(iota-framework): removed the iota supply constants
valeriyr Jul 11, 2024
c87eaf7
Merge pull request #1127 from iotaledger/sc-platform/issue-153-remove…
valeriyr Jul 11, 2024
e0fe0b8
Merge branch 'sc-platform/genesis-staking' into sc-platform/issue-153
valeriyr Jul 12, 2024
f314ee4
fix: advance_epoch comments
PhilippGackstatter Jul 12, 2024
c6d3112
fix(iota-framework-snapshot): the snapshots were updated
valeriyr Jul 12, 2024
312d1e7
Merge remote-tracking branch 'origin/sc-platform/issue-153' into sc-p…
PhilippGackstatter Jul 12, 2024
b53b70d
fix: Improve post distribution validator reward variable name
PhilippGackstatter Jul 12, 2024
8f6b0df
fix: Comment on IOTA treasury cap creation
PhilippGackstatter Jul 12, 2024
73be08b
feat: Match subsidy fund params in test to genesis config
PhilippGackstatter Jul 12, 2024
ccdc305
fix: Remove stake subsidy fund test
PhilippGackstatter Jul 12, 2024
d14614e
fix: Remove unused import
PhilippGackstatter Jul 12, 2024
0d8b431
refactor: Remove `mint_genesis_supply` function
PhilippGackstatter Jul 12, 2024
6e26ba5
feat: Regenerate framework snapshot
PhilippGackstatter Jul 12, 2024
1fba238
feat: Call `mint_balance` on genesis instead
PhilippGackstatter Jul 12, 2024
188d0e2
feat: iota-genesis-builder was corrected according to inflation mecha…
valeriyr Jul 12, 2024
c6ae6b5
fix(iota-framework-snapshot): the snapshots were regenerated
valeriyr Jul 12, 2024
b129cdb
fix(iota-genesis-builder): the destroy_genesis_supply function call w…
valeriyr Jul 12, 2024
c9d36a5
fix(iota-genesis-builder): integrated pre-minted supply into GenesisS…
valeriyr Jul 15, 2024
667fca2
fix: typos and documentation
valeriyr Jul 15, 2024
8a1578c
fix: changed naming TokenDistributionScheduleBuilder::add_pre_minted_…
valeriyr Jul 15, 2024
63b5db1
fix(iota-genesis-builder): integrated pre-minted IOTA supply into van…
valeriyr Jul 15, 2024
4043775
refactor(iota-genesis-builder): added calculate_pre_minted_supply fun…
valeriyr Jul 15, 2024
1bd2c04
fix(iota-genesis-builder): added documentation
valeriyr Jul 15, 2024
b45d190
Merge pull request #1155 from iotaledger/sc-platform/issue-1063-fix-g…
valeriyr Jul 15, 2024
b23b478
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 15, 2024
697bcf6
feat: Sync iota-execution `v0` with `latest`
PhilippGackstatter Jul 15, 2024
0d456bf
fix: Remove outstanding burn tokens TODO
PhilippGackstatter Jul 16, 2024
8520db3
fix: Rename stake subsidy consistently
PhilippGackstatter Jul 18, 2024
7a33794
fix: Test snapshots in iota-swarm-config
PhilippGackstatter Jul 18, 2024
222fa95
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 19, 2024
fbbd01c
fix(iota-core): Fix CI after inflation introduction (#1196)
Dkwcs Jul 19, 2024
76a3809
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 22, 2024
7dc5ea5
fix: spelling mistakes
valeriyr Jul 22, 2024
f282273
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 22, 2024
693ed7e
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 22, 2024
9f570e5
fix(iota-framework): cargo fmt
valeriyr Jul 22, 2024
1a95ce0
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 22, 2024
da19bbd
Merge branch 'develop' into sc-platform/issue-153
valeriyr Jul 23, 2024
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
Prev Previous commit
Next Next commit
Merge branch 'develop' into sc-platform/issue-153
  • Loading branch information
valeriyr committed Jul 22, 2024
commit 693ed7eb583bbb65f5b4206b6fa2cf2d1763896a
56 changes: 44 additions & 12 deletions crates/iota-framework/build.rs
Original file line number Diff line number Diff line change
@@ -231,20 +231,29 @@ fn build_packages_with_move_config(
/// for a package into a flat list of packages;
/// * Deduplicate packages (since multiple packages could share dependencies);
/// and
/// * Write out the package docs in a flat directory structure.
/// * Replace html tags and use Docusaurus components where needed.
fn relocate_docs(prefix: &str, files: &[(String, String)], output: &mut BTreeMap<String, String>) {
// Turn on multi-line mode so that `.` matches newlines, consume from the start
// of the file to beginning of the heading, then capture the heading and
// replace with the yaml tag for docusaurus. E.g., ```
// of the file to beginning of the heading, then capture the heading as three different parts and
// replace with the yaml tag for docusaurus, add the Link import and the title anchor,
// so the tile can be linked to. E.g., ```
// -<a name="0x2_display"></a>
// -
// -# Module `0x2::display`
// -
// +---
// +title: Module `0x2::display`
// +---
// +
// +import Link from '@docusaurus/Link';
// +<Link id="0x2::display"/>
//```
let re = regex::Regex::new(r"(?s).*\n#\s+(.*?)\n").unwrap();
let title_regex = regex::Regex::new(r"(?s).*\n#\s+(.*?)`(\S*?)`\n").unwrap();
let link_from_regex = regex::Regex::new(r#"<a name=\"([^\"]+)\"></a>"#).unwrap();
let link_to_regex = regex::Regex::new(r#"<a href="(\S*)">([\s\S]*?)</a>"#).unwrap();
let code_regex = regex::Regex::new(r"<code>([\s\S]*?)<\/code>").unwrap();
let type_regex = regex::Regex::new(r"(\S*?)<(IOTA|SMR|0xabcded::soon::SOON|T)>").unwrap();

for (file_name, file_content) in files {
let path = PathBuf::from(file_name);
let top_level = path.components().count() == 1;
@@ -257,14 +266,37 @@ fn relocate_docs(prefix: &str, files: &[(String, String)], output: &mut BTreeMap
new_path.push(path.components().skip(1).collect::<PathBuf>());
new_path.to_string_lossy().to_string()
};
output.entry(file_name).or_insert_with(|| {
re.replace_all(
&file_content
.replace("../../dependencies/", "../")
.replace("dependencies/", "../"),
"---\ntitle: $1\n---\n",
)
.to_string()

// Replace a-tags with Link to register anchors in Docusaurus (we have to use the `id` attribute as `name` is deprecated and not existing in Link component)
let content = link_from_regex.replace_all(&file_content, r#"<Link id="$1"></Link>"#);

// Replace a-tags with href for Link tags to enable link and anchor checking. We need to make sure that `to` path don't contain extensions in a later step.
let content = link_to_regex.replace_all(&content, r#"<Link to="$1">$2</Link>"#);

// Escape `{` in <code> and add new lines as this is a requirement from mdx
let content = code_regex.replace_all(&content, |caps: &regex::Captures| {
let code_content = caps.get(1).unwrap().as_str();
format!("<code>\n{}</code>", code_content.replace("{", "\\{"))
});

// Wrap types like '<IOTA>', '<T>' and more in backticks as they are seen as
// React components otherwise
let content = type_regex.replace_all(&content, r#"`$1<$2>`"#);

let content = content
.replace("../../dependencies/", "../")
.replace("dependencies/", "../")
// Here we remove the extension from `to` property in Link tags
.replace(".md", "");

// Store all files in a map to deduplicate and change extension to mdx
output.entry(format!("{}x", file_name)).or_insert_with(|| {
title_regex.replace_all(&content, |caps: &regex::Captures| {
let title_type = caps.get(1).unwrap().as_str();
let name = caps.get(2).unwrap().as_str();
let anchor = name.replace("::", "_");
format!("---\ntitle: {}`{}`\n---\nimport Link from '@docusaurus/Link';\n\n<Link id=\"{}\"/>", title_type, name, anchor)
}).to_string()
});
}
}
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.