Skip to content

简化CallRequest #2

@rink1969

Description

@rink1969

目前 executor.protoCallRequest定义如下:

message CallRequest {
    // 1. length is 20 bytes for evm.
    // 2. if executor is multi-vm, it will be a path.
    bytes to = 1;
    bytes from = 2;
    // 4 bytes for evm.
    bytes method = 3;
    repeated bytes args = 4;
}

executor的具体实现开发者认为,这里的methodargs合并为一个bytes即可。
因为不管是evm还是chaincode,都有自己的定义的结构来描述methodargs,所以现在实现是在客户端直接进行序列化。
按照现有CallRequest定义传递,executor需要做额外的封装工作。

统一CallRequest的好处是,客户端就不需要感知具体的executor实现,可以实现一个统一的SDK

但是现在的问题是,有些处理必须在客户端做,executor没法代劳。比如,chain code在执行query操作的时候,也是要对call data做签名的。这里涉及到不同executor实现设计上的差异。

要想实现统一接口,统一的SDK,需要先把不同executor实现的差异抹平,否则executor.proto这里就只能透传。

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