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

#132 Connector Redesign [WIP] #201

Closed
wants to merge 35 commits into from

Conversation

Lohann
Copy link
Collaborator

@Lohann Lohann commented Oct 27, 2023

Description

Connector Redesign - Work in Progress

This work drastically changes the connector api, some changes includes:

  • Make connector API opaque, inputs and outputs should be just byte blobs
  • Reliably Detect EVM vs Availability errors as proposed here
  • Creates an interface that easily allows onboarding new evm compatible chains
  • Refactor connector interface to be chain agnostic (wip)
  • unit tests (wip)

Fixes #132

Type of change

  • New feature
  • Breaking changes

Code review prechecks:

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Inline comments have been added for each method
  • I have made corresponding changes to the documentation
  • Code changes introduces no new problems or warnings
  • Test cases have been added
  • Dependent changes have been merged and published in downstream modules

@Lohann Lohann requested a review from dvc94ch October 27, 2023 13:38
Comment on lines 14 to 18
serde(rename_all = "camelCase")
)]
pub struct Block<TX> {
/// Hash of the block
pub hash: H256,
Copy link
Collaborator Author

@Lohann Lohann Oct 27, 2023

Choose a reason for hiding this comment

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

I had to re-implement some ethers-rs primitives because they didn't implement scale-codec and scale-info traits.

I'm using the scale-info to generate the metadata for allowing timegraph and other components to parse the encoded task.

Comment on lines 387 to 409
#[derive(Decode, Encode)]
pub enum Query {
/// Returns the balance of the account of given address.
GetBalance(GetBalanceQuery),
/// Returns the value from a storage position at a given address.
GetStorageAt(GetStorageAtQuery),
/// Returns the receipt of a transaction by transaction hash.
GetTransactionReceipt(GetTransactionReceiptQuery),
/// Executes a new message call immediately without creating a transaction on the block
/// chain.
CallContract(CallContractQuery),
/// Returns the account and storage values of the specified account including the
/// Merkle-proof. This call can be used to verify that the data you are pulling
/// from is not tampered with.
GetProof {
/// Address of the Account
address: Address,
/// an array of storage-keys that should be proofed and included
storage_keys: Vec<U256>,
/// State at the block
block: BlockIdentifier,
},
}
Copy link
Collaborator Author

@Lohann Lohann Oct 27, 2023

Choose a reason for hiding this comment

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

This is the new definition of ethereum read-only tasks, this type is scale encoded/decoded by the connector.

@Lohann Lohann closed this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connector redesign
1 participant