Skip to content

Allow for customising defaulters #828

Description

@baitcode

Feature request to allow for customisation of defaulters.

In my project I want to be able to use custom defaulter implementation that does not use node HTTP API but rather connect to starknet state database directly.

API change proposal:

starknet_devnet_core::starknet::defaulter::StarknetDefaulter::register_defaulter(
    "sqlite",
    SQLiteStateReader::new_sqlite_state_reader,
)

SQLiteStateReader should implement OriginReader trait

pub trait OriginReader: std::fmt::Debug + Send + Sync {
    fn get_storage_at(
        &self,
        contract_address: ContractAddress,
        key: StorageKey,
    ) -> StateResult<Felt>;
    fn get_nonce_at(&self, contract_address: ContractAddress) -> StateResult<Nonce>;
    fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult<RunnableCompiledClass>;
    fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult<ClassHash>;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions