-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ensure TransactionArgs works with cip-64 and cip-66 #109
Comments
Mainly putting this here for rubber-ducking, if you have opinions on this feel free to comment though What is not completely clear to me is how to distinguish between Celo denominated (CIP66) and fee-currency denominated transactions (CIP64) in the transaction arguments, especially when the RPC method internally also sets sane defaults if fields are missing. Methods that will set sane defaults for some fields:
In general, without a qualifying field like
The latter case has the downside, that legacy clients might assume fee-currency denominated gas-prices but simply haven't done an explicit gas-estimation. This could lead to overpaying gas-fees. How do we solve this ambiguity?The easiest fix would be to make If we want to suggest a sane MaxFeeInFeeCurrency, how would we do that? TL;DRIn some JSON RPC methods the transaction type is inferred by lack or presence of some fields. SuggestionIt's probably best to not allow the CIP-66 estimations for now and make the clients do them with explicit calls (estimateGas, maxPriorityFeePerGas). Once CIP-64 transactions are deprecated, we can drop support for older clients and always assume Celo denominated gas prices as the basis for calculating sane defaults. The problem with this approach is that the semantics of the API changes over time without proper versioning, and a clear cut upgrade might be hard to time with multiple client libraries. Another alternative would be to instead add a |
@aaronmgdr came across the same problem for the client libraries. You might want to sync with him on this. |
i didnt even consider that the geth client can receive tx as json as well as the rlp encoded. this is interesting. I was thinking that maxFeeInFeeCurrency was required. but i suppose not for eth_fillTransaction.
client in this sentence meaning the one sending the tx? or the geth-client? and they need to know the gas and price because it is computed from them. yes makes sense
for 1. I think they could be intending cip64 or cip66. and apart from guessing based on the values there really is no way to know. |
if it helps none of the js libraries (contractkit, viem, ethers-wrapper) that support cip64 use the |
i dont understand the logic here. why would not having gas limit but having maxFeePerGas mean this was cip66 and not cip64? |
It would be a compromise, to allow at least one combination of arguments to mean CIP64. The reasoning here is that knowing all gas related fields you could already compute the
You are right, in the current But should we require it for CIP-66 transactions? If we don't then we have to be comfortable with defining and using a default "slippage" for the I think when you follow the normal Ethereum RPC logic one would expect the parameter to be optional - especially since making it required would also remove the gas-price and gas-limit calculation in those procedures, since they need to be known in advance anyways. So you are saying all JS libraries that are Celo compatible use If no, we don't need to consider backwards compatibility for those procedures and can prioritize CIP-66 usability. |
Viemtransactions missing fee price fields are filled using eth_gasPrice an eth_maxPriorityFeePerGas. typical eip 1559 txns get the data from block a search for eth_fillTransactions in repo returns 0 results celo-ethers-wrappertransactions missing fee price fields are filled using eth_gasPrice an eth_maxPriorityFeePerGas a search for eth_fillTransactions in repo returns 0 results Contract Kitall calls are eth_sendTransaction are intercepted and turned into eth_sendRawTransaction calls transaction missing fee price fields are filled using eth_gasPrice an eth_maxPriorityFeePerGas a search for eth_fillTransactions in repo returns 0 results |
MiniPay uses their own java based system for transaction serialization, sending rpc calling etc. indexers would be read only so i dont see why they would care. |
@ezdac can you provide a status update? how much and what is left to do? |
It will need around a half day of refining the PR #123 and then the review / potential requested changes revision. |
@ezdac can you provide another status update and an ETA? |
@lvpeschke no updates so far, since I prioritized other work. The PR will be finalized beginning of this week, the ETA then depends on review/requested changes. |
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Fixes #109 Add CIP-66 transaction type This introduces the CeloDenominatedTx type, which will when implemented allow for the fee-currency to be denominated in cel2 native token. Make the TransactionArgs CIP-64/CIP-66 compatible The TransactionArgs are used in some API endpoints to fill incomplete fields of passed in transactions and then convert this internally to an EVM-message or Transaction. This PR adds code that distinguishes some combination of passed in fields for the TransactionArgs between CIP-64 and CIP-66 transactions in order to create the concrete internal transaction type. The filling of missing required fields now considers wether the transaction is Celo-denominated or not. Additionally, the new MaxFeeInFeeCurrency field is passed along to the internal transaction representations Included commits: * Format comments in TransactionArgs fields * Add CIP-66 tx type (Celo denominated) Co-authored-by: bandu * Fix nil-deref in CIP-66 Transaction getter * Fix required RLP field for fee-currency in CIP66 * Fix initialize MaxFeePerFeeCurrency value upon copy * Convert TransactionArgs to CIP-64/66 transaction Closes #109 * Add MaxFeeInFeeCurrency to EVM Message * Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing * Add tests for CIP-64/66 compatible TransactionArgs * Fix call-arg naming for currency conversion * Fix comments and formatting
Rationale
In celo-blockchain transactions can be sent as arguments, and internal/ethapi/transaction_args.go creates the proper transaction type, and signed from an unlocked account. This is currently missing in op-geth.
Implementation
Implementation should be analog to celo-blockchain's implementation.
The text was updated successfully, but these errors were encountered: