NethermindEth / juno

Starknet client implementation.
https://juno.nethermind.io
Apache License 2.0
404 stars 170 forks source link

`MaxFee` field for all types of transactions should be removed for V3 #2129

Open TAdev0 opened 2 months ago

TAdev0 commented 2 months ago

Here is the official spec / doc from Starknet :

https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions

MaxFee was used in V0 / V1 (and V2 for declare) , setting the maximum fee that the sender is willing to pay for the transaction.

This MaxFee field has been replaced by a combination of resource_bounds and tip to handle fees for the V3 of all tx types (declare, deploy, invoke).

Currently, Juno codebase suggests that MaxFee is present also in V3 transactions which is wrong, as it is added in the list of first fields that are ''common'', and then you list fields for specific with a comment, as shown here:

Deploy https://github.com/NethermindEth/juno/blob/main/core/transaction.go#L228

Invoke https://github.com/NethermindEth/juno/blob/main/core/transaction.go#L259

Declare https://github.com/NethermindEth/juno/blob/main/core/transaction.go#L310