Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

feat: Add l1_gas_price and starknet_version to block and pending block headers #1303

Closed
antiyro opened this issue Dec 6, 2023 · 7 comments
Closed
Labels

Comments

@antiyro
Copy link
Contributor

antiyro commented Dec 6, 2023

Feature Request

Add l1_gas_price and starknet_version to block and pending block headers

This issue aims to implement l1_gas_price and starknet_versionto BLOCK_HEADER and PENDING_BLOCK_HEADER
Based on the following specs: https://github.com/starkware-libs/starknet-specs/blob/v0.6.0-rc5/api/starknet_api_openrpc.json#L1375

l1_gas_price Element:

  • Title: L1 Gas Price
  • Description: This element represents the price of Layer 1 (L1) gas in a given block.
  • Reference: The element references a schema defined under components/schemas/RESOURCE_PRICE check here

starknet_version Element:

  • Title: StarkNet Version
  • Description: This element specifies the version of the Starknet protocol being used. The version is indicated using Semantic Versioning (SemVer). Please do not confuse with spec_version returning RPC spec version!
  • Type: The type of this element is defined as a string. The implementation must validate that the version string adheres to the SemVer format. If no version is specified an empty string should be returned like "starknet_version":""

Exepected behavior

exemple with in starknet_getBlockWithTxHashes for Starknet mainnet on block: 40000

Capture d’écran 2023-12-06 à 16 57 59
@antiyro antiyro added the enhancement New feature or request label Dec 6, 2023
@antiyro
Copy link
Contributor Author

antiyro commented Dec 6, 2023

This issue is related to a task under #1291

@antiyro
Copy link
Contributor Author

antiyro commented Dec 8, 2023

Taking this one

@antiyro
Copy link
Contributor Author

antiyro commented Dec 11, 2023

1 field to be removed from this issue:

2 new field to be added to this issue:

  • execution_ressources

Description: Details the resources used by the VM during transaction execution, including various computational and memory metrics.

Type: Object

Properties:

  1. Steps: Total Cairo steps used. Type: Integer. Must not be 0.
  2. Memory Holes: Unused memory cells. Type: Integer. Must not be 0.
  3. Range Check Builtin Applications: RANGE_CHECK instances used. Type: Integer. Must not be 0.
  4. Pedersen Builtin Applications: Pedersen hash function instances. Type: Integer. Must not be 0.
  5. Poseidon Builtin Applications: Poseidon hash function instances. Type: Integer. Must not be 0.
  6. EC_OP Builtin Applications: Elliptic curve operation instances. Type: Integer. Must not be 0.
  7. ECDSA Builtin Applications: ECDSA operation instances. Type: Integer. Must not be 0.
  8. Bitwise Builtin Applications: Bitwise operation instances. Type: Integer. Must not be 0.
  9. Keccak Builtin Applications: KECCAK hash function instances. Type: Integer. Must not be 0.
  10. Segment Arena Builtin: Segment arena accesses. Type: Integer. Must not be 0.

Required Fields: steps is a required field.

  • message_hash

Description: Represents the hash of the message as it appears on the L1 core contract.

Type: String, formatted as a hexadecimal number.

Pattern: The hash should match the format ^0x[a-fA-F0-9]+$, indicating a string that starts with 0x followed by hexadecimal characters (0-9, a-f, or A-F).

@antiyro
Copy link
Contributor Author

antiyro commented Dec 11, 2023

Those can be find under TODO(#1291) assignments in the code base

@makluganteng
Copy link
Contributor

Would like to research on the l1_gas_price if thats okey

Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@antiyro
Copy link
Contributor Author

antiyro commented Mar 8, 2024

closing this issue since it has been implemented in v0.5.1 already

@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants