Skip to content

[Bug] miner_setMaxDASize should return bool type #345

@SangyunOck

Description

@SangyunOck

Component

rpc-jsonrpsee

What version of op-alloy are you on?

0.8.3

Operating System

macOS (Apple Silicon)

Describe the bug

Motivation

ERROR[12-17|18:17:23.568] Result of SetMaxDASize was false, retrying.

golang implementation of optimism's op-geth returns bool type for miner_setMaxDASize call. Therefore, expected response might be like following:

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": true
}

On the other hand, current trait returns (), represents null for json.

pub trait MinerApiExt {
    /// Sets the maximum data availability size of any tx allowed in a block, and the total max l1
    /// data size of the block. 0 means no maximum.
    #[method(name = "setMaxDASize")]
    async fn set_max_da_size(&self, max_tx_size: U64, max_block_size: U64) -> RpcResult<()>; // should return bool
}
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": null
}

Solution

alter () to bool for return type

async fn set_max_da_size(&self, max_tx_size: U64, max_block_size: U64) -> RpcResult<bool>;

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