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

fix: support Forrest parity testing for F3 participation APIs #12615

Merged
merged 4 commits into from
Oct 18, 2024

Commits on Oct 18, 2024

  1. Support Forrest parity testing for F3 participation APIs

    For parity testing, Forest nodes need to decode an F3 participation
    ticket that is issued by Lotus. Lotus so happens to use CBOR to encode
    tickets, which it then decodes to issue a lease.
    
    The lease issuer is of type `peer.ID` which is an alias of type `string`
    that may contain non UTF-8 characters. If this type is used directly in
    CBOR encoding then it gets encoded as string, which works fine in Golang
    but not Rust, which in turn results in decoding issues in Forest.
    
    To avoid this use `[]byte` as the type to encode the issuer public key.
    In Lotus, the value will be the binary marshalling of `peer.ID` that
    issued the ticket.
    
    While at it, also fix two issues that were brought up during discussion:
    
    * A miner must not be able to ask for a ticket to participate in zero
      instances. Validate and return error if instances is set to zero.
    
    * Use CBOR tuple encoding for a slightly better efficient wire encoding
      of ticket. `cborgen.Write*` APIs explicitly create a given file; hence
      the need to separate the file to which tuple kinds are generated since
      the existing encoding for types in `api/cbor_gen.go` use maps.
    masih committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    324bd28 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    90ebb56 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b7bd37e View commit details
    Browse the repository at this point in the history
  4. Fix lint issue

    masih committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    7fe791c View commit details
    Browse the repository at this point in the history