starknet-devnet-rs icon indicating copy to clipboard operation
starknet-devnet-rs copied to clipboard

Block hash computation

Open marioiordanov opened this issue 2 years ago • 11 comments

Check the implementation of Madara project for computing the block hash.

marioiordanov avatar Jul 03 '23 13:07 marioiordanov

Our hash calculation is different than on testnet / Madara. It is probably not relevant for users, but can be improved potentially to be the same

ivpavici avatar Feb 05 '24 08:02 ivpavici

Hi @ivpavici, what is the call to action here please? I would like to hop on it.

0xibs avatar Apr 20 '24 18:04 0xibs

Hi @ivpavici, still anticipating your reply. Thanks

0xibs avatar Apr 22 '24 02:04 0xibs

Can I work on this?

RajeshRk18 avatar Apr 22 '24 06:04 RajeshRk18

@marioiordanov Please can you add more context to this issue? Am I reimplementing the function for computing block hash?

0xibs avatar Apr 24 '24 14:04 0xibs

And also going through the development docs linked in the README, I found this warning image Is it still safe to use it? @marioiordanov @ivpavici

0xibs avatar Apr 24 '24 14:04 0xibs

As you can see the generate_hash of StarknetBlock contains mostly dummy values. The idea is to make it similar to mainnet

marioiordanov avatar Apr 24 '24 15:04 marioiordanov

@marioiordanov this is the closest I could find to compute block hash in Madara project: https://github.com/keep-starknet-strange/madara/blob/main/crates/primitives/block/src/header.rs#L85

Please kindly confirm if that is what I am supposed to look into.

0xibs avatar Apr 25 '24 05:04 0xibs

yes

marioiordanov avatar Apr 25 '24 10:04 marioiordanov

And also going through the development docs linked in the README, I found this warning image Is it still safe to use it? @marioiordanov @ivpavici

@marioiordanov @ivpavici kindly see this please. It's a blocker for me.

0xibs avatar Apr 26 '24 17:04 0xibs

And also going through the development docs linked in the README, I found this warning image Is it still safe to use it? @marioiordanov @ivpavici

@marioiordanov @ivpavici kindly see this please. It's a blocker for me.

Not sure what you mean about the warning? Why is it a blocker? It is a message from the old devnet, not devnet-rs

ivpavici avatar Apr 29 '24 09:04 ivpavici

Probably this issue is not of a such importance, because:

  • devnet doesn't have the hashes of the events, which are needed for producing the correct block hash.
  • users using devnet dont compare the block hash to the hash generated on testnet/mainnet

marioiordanov avatar Aug 29 '24 07:08 marioiordanov