Skip to content

Commit

Permalink
(fix) Default rustfmt to the 2021 edition
Browse files Browse the repository at this point in the history
(feat) docgen can now build docs from an external zq2 (so we can run a network and get docs at the same time)
(fix) Wording changes for changes.md
  • Loading branch information
rrw-zilliqa committed Jun 3, 2024
1 parent fdcb25c commit e3cd1ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions docgen/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edition="2021"
25 changes: 17 additions & 8 deletions docgen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ async fn main() -> Result<()> {
let here = String::from(&args[1]);

// Set NO_CHECKOUT to skip the checkout steps - this allows you to do debugging with symlinks or similar.
let checkout = std::env::var("NO_CHECKOUT").is_err();
let mut checkout = std::env::var("NO_CHECKOUT").is_err();

// Find the zq2 versions that we need to collect.

println!("here = {here}");

let root_path = PathBuf::from(&here);
let versions: Zq2Spec =
serde_yaml::from_str(&fs::read_to_string(format!("{}/zq2_spec.yaml", here))?)?;
Expand All @@ -45,8 +42,20 @@ async fn main() -> Result<()> {
Some(ref val) => val.to_string(),
};
println!("Compiling zq2 version {name}");
let cache_dir: PathBuf = root_path.clone().join("cache");
let zq2_checkout_dir: PathBuf = cache_dir.clone().join("zq2");
let mut cache_dir: Option<PathBuf> = Some(root_path.clone().join("cache"));
let mut zq2_checkout_dir: PathBuf;
if let Ok(val) = std::env::var("USE_ZQ2_FROM") {
checkout = false;
cache_dir = None;
zq2_checkout_dir = PathBuf::from(val);
} else if let Some(val) = &cache_dir {
zq2_checkout_dir = val.clone().join("zq2");
} else {
return Err(anyhow!(
"No zq2 specified - no cache dir and USE_ZQ2_FROM is not specified"
));
}

let id_prefix = format!("Versions/{name}");
let target_dir = root_path.clone().join("zq2").join("docs");
let target_dir_str = target_dir
Expand All @@ -67,11 +76,11 @@ async fn main() -> Result<()> {
.run_logged()
.await?
.success_or("Cannot run git fetch")?
} else {
} else if let Some(val) = &cache_dir {
// Clone
CommandBuilder::new()
.cmd("git", &["clone", "https://github.com/zilliqa/zq2"])
.current_dir(&cache_dir.clone())?
.current_dir(&val.clone())?
.run_logged()
.await?
.success_or("Cannot run git clone")?
Expand Down
5 changes: 5 additions & 0 deletions zq2/docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ There are a number of differences between Zilliqa 1.0 and Zilliqa 2.0 that you s
- Zilliqa 2.0 has a much faster block time (there is typically a hardwired minimum of 1s/block); dApp operators will need to make sure that where they use block number as a proxy for a timestamp, they allow sufficient blocks for users to react.
- Zilliqa 2 upgrades are seamless and relatively quick; you don't need to redownload persistence and there is an auto-upgrader you can run if you wish which will run the newer version of zq2 and cut over when ready. We hope this will enable us to eliminate upgrade downtime and to make more frequent bug fixes.

## API differences

- There are no DS epochs any longer (though some are faked to allow existing applications that retrieve the current DS epoch to work), so the transaction pool is no longer cleared at the start of a DS epoch.
- `GetTransactionStatus` no longer depends on an off-chain transaction store, and therefore now works for any transaction.

## Continuity

There are also a number of things that have not changed:
Expand Down

0 comments on commit e3cd1ab

Please sign in to comment.