ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
632 stars 153 forks source link

fix(rpc): make some fields of MessageLotusJson optional for deserialization #4440

Closed hanabi1224 closed 3 months ago

hanabi1224 commented 3 months ago

Summary of changes

Part of https://github.com/ChainSafe/forest/issues/4424

2) 'Message` deserialization has required fields that are optional in Lotus and default to 0 there

Changes introduced in this pull request:

Manual test result

Payload:

{"jsonrpc":"2.0","id":0,"method":"Filecoin.GasEstimateGasLimit","params":
[
    {
        "From": "f15ydyu3d65gznpp2qxwpkjsgz4waubeunn6upvla",
        "To": "f15ydyu3d65gznpp2qxwpkjsgz4waubeunn6upvla",
        "Value": "1000000000000000000"
    },
    [
        {
            "/": "bafy2bzacedejh3rhguvzgnt6wergwcuuecgw42kx2uxmqdwpuyzvdwjwla4wq"
        },
        {
            "/": "bafy2bzacebp67qmhv6okvhgdtjhh4v5ewpw7ar77dfbhhmsqx2vwnkrv3is56"
        },
        {
            "/": "bafy2bzaceciiv7y65ony3eg4h2ah5kpaiymjxmjbje62h7i77kivwufunlx7m"
        }
    ]
]
}

lotus response

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

forest response

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

Payload:

{"jsonrpc":"2.0","id":0,"method":"Filecoin.GasEstimateGasLimit","params":
[
    {
        "From": "f15ydyu3d65gznpp2qxwpkjsgz4waubeunn6upvla",
        "To": "f15ydyu3d65gznpp2qxwpkjsgz4waubeunn6upvla"
    },
    [
        {
            "/": "bafy2bzacedejh3rhguvzgnt6wergwcuuecgw42kx2uxmqdwpuyzvdwjwla4wq"
        },
        {
            "/": "bafy2bzacebp67qmhv6okvhgdtjhh4v5ewpw7ar77dfbhhmsqx2vwnkrv3is56"
        },
        {
            "/": "bafy2bzaceciiv7y65ony3eg4h2ah5kpaiymjxmjbje62h7i77kivwufunlx7m"
        }
    ]
]
}

lotus response

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

forest response

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

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist