Git Product home page Git Product logo

Comments (2)

bernardoaraujor avatar bernardoaraujor commented on September 2, 2024 2

we originally chose genesis but it's not a hard requirement

it's actually not ideal, depending on how you look at it (we want to check pre-conditions immediately before the benchmarking starts, not a long time ago)

this can be easily achieved by changing this:

async fn check_account(api: &Api, account: &AccountId32) -> Result<(), Error> {
let ext_deposit_addr = runtime::constants().balances().existential_deposit();
let ext_deposit = api.constants().at(&ext_deposit_addr)?;
let genesis = 0u32;
let genesis_hash = api.rpc().block_hash(Some(genesis.into())).await?;
// let account_state = runtime::storage().system().account(account, genesis_hash).await?;
let account_state_storage_addr = runtime::storage().system().account(account);
let account_state =
api.storage().fetch(&account_state_storage_addr, genesis_hash).await?.unwrap();

where genesis can be simply replaced with head and the effect would be the same

from polkadot-stps.

bredamatt avatar bredamatt commented on September 2, 2024

The above would work for relaychains specifically, but when we target parachains things would again get a bit more complicated since we need to check the last parachain block.
The quick fix which comes to my mind is simply doing what we do in tps, passing the latest para head to the parachain subxt client and checking the accounts from the last included parablock.

Edit
Actually, not sure if it is possible to check the accounts in the parablock in the same way exactly. If it is, then I suspect it would be fine to just look at the last finalised head, and run the pre-checks as usual since the node_url is specifically either a collator, or relay chain node. 🤔 There are two commits on the associated PR which adds some more context.

from polkadot-stps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.