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

GENESIS_BLOCK_HASH constants #209

Open
DOBEN opened this issue Sep 4, 2024 · 0 comments
Open

GENESIS_BLOCK_HASH constants #209

DOBEN opened this issue Sep 4, 2024 · 0 comments
Labels
[Type] Task An additional feature or improvement.

Comments

@DOBEN
Copy link
Member

DOBEN commented Sep 4, 2024

Task description

Add hardcoded constants TESTNET_GENESIS_BLOCK_HASH and MAINNET_GENESIS_BLOCK_HASH to the SDKs. These constants are frequently used by the dapps. STAGENET_GENESIS_BLOCK_HASH won't be added for flexibility since the network might be restarted if needed.
https://github.com/Concordium/concordium-dapp-examples/blob/e34d1a55e92bb912695147f9561afe4af6af2620/compliant-reward-distribution/indexer-and-server/src/constants.rs#L5

The variable should be in bytes but their display trait has a hexDecimal representation.
pub const TESTNET_GENESIS_BLOCK_HASH: [u8; 32] = [
66, 33, 51, 45, 52, 225, 105, 65, 104, 194, 160, 192, 179, 253, 15, 39, 56, 9, 97, 44, 177, 61,
0, 13, 92, 46, 0, 232, 95, 80, 247, 150,
];

The current suggestion would be to add the constants to contracts-common in base (https://github.com/Concordium/concordium-base/tree/main/smart-contracts/contracts-common) (if it doesn't increase the module size of smart contracts without the constant - investigation needed) and make the constants available in smart contracts as well. (https://github.com/Concordium/concordium-rust-smart-contracts/blob/main/examples/cis5-smart-contract-wallet/src/lib.rs#L49).

@DOBEN DOBEN added the [Type] Task An additional feature or improvement. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Task An additional feature or improvement.
Projects
None yet
Development

No branches or pull requests

1 participant