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

dev: parse v0.11.0 DA calldata #1209

Closed
wants to merge 9 commits into from
Closed

dev: parse v0.11.0 DA calldata #1209

wants to merge 9 commits into from

Conversation

drspacemn
Copy link
Contributor

@drspacemn drspacemn commented Oct 21, 2023

  • add support for v0.11.0 manual DA parsing from storage notification stream
  • include encoding for DA word encoding
  • storage change parsing is done in a ThinStateDiff structure (potential to add scale encoding to this api type and save this to the kv db)
  • add da config examples
  • add cli flag for --da-conf as the dev file overrides don't include the da config
cargo run --release -- --dev --da-layer ethereum --da-conf examples/da-confs/ethereum.json

Pull Request type

  • Bugfix
  • Feature [x]
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing
  • Other (please describe):

What is the current behavior?

  • the DA client currently encodes the prev0.11.0 da format

Resolves: #NA

What is the new behavior?

  • encode the v0.11.0 fmt

Does this introduce a breaking change?

minor - if use or import of exposed util functions

Comment on lines 45 to +50
#[clap(long)]
pub da_layer: Option<DaLayer>,

/// Choose a supported DA Layer
#[clap(long)]
pub da_conf: Option<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make them an arg group.
The whole group is optional, but as soon as one is used, all must be

@@ -76,57 +82,82 @@ where
{
pub async fn prove_current_block(da_mode: DaMode, client: Arc<C>, madara_backend: Arc<mc_db::Backend<B>>) {
let mut storage_event_st = client
.storage_changes_notification_stream(None, None)
.storage_changes_notification_stream(None, Some(&[(SubStorageKey(twox_128(PALLET_STARKNET).into()), None)]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can go (None, None) unti we get some light on paritytech/polkadot-sdk#1989

accessed_addrs.insert(ContractAddress(bytes_to_key(&rest_key)));
} else if child_key == twox_128(STARKNET_STORAGE) {
// collect storage update information in state diff
if rest_key.len() > 32 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this could be false.

@drspacemn drspacemn marked this pull request as draft October 23, 2023 17:27
@drspacemn
Copy link
Contributor Author

holding for work here: #1217

Copy link

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Nov 23, 2023
@EvolveArt EvolveArt closed this Nov 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants