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

Rafactor: update FeeParams field types from uint64 to big.Int #72

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions types/fee.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package types

import "github.com/ethereum/go-ethereum/common/hexutil"
import (
"github.com/ethereum/go-ethereum/common/hexutil"
"math/big"
)

// Fee represents the transaction fee parameters.
type Fee struct {
Expand All @@ -17,14 +20,19 @@ type FeeParams struct {
V2 struct {
// Settings related to transaction fee computation.
Config struct {
MinimalL2GasPrice uint64 `json:"minimal_l2_gas_price"` // Minimal gas price on L2.
ComputeOverheadPart uint64 `json:"compute_overhead_part"` // Compute overhead part in fee calculation.
PubdataOverheadPart uint64 `json:"pubdata_overhead_part"` // Public data overhead part in fee calculation.
BatchOverheadL1Gas uint64 `json:"batch_overhead_l1_gas"` // Overhead in L1 gas for a batch of transactions.
MaxGasPerBatch uint64 `json:"max_gas_per_batch"` // Maximum gas allowed per batch.
MaxPubdataPerBatch uint64 `json:"max_pubdata_per_batch"` // Maximum amount of public data allowed per batch.
MinimalL2GasPrice *big.Int `json:"minimal_l2_gas_price"` // Minimal gas price on L2.
ComputeOverheadPart *big.Int `json:"compute_overhead_part"` // Compute overhead part in fee calculation.
PubdataOverheadPart *big.Int `json:"pubdata_overhead_part"` // Public data overhead part in fee calculation.
BatchOverheadL1Gas *big.Int `json:"batch_overhead_l1_gas"` // Overhead in L1 gas for a batch of transactions.
MaxGasPerBatch *big.Int `json:"max_gas_per_batch"` // Maximum gas allowed per batch.
MaxPubdataPerBatch *big.Int `json:"max_pubdata_per_batch"` // Maximum amount of public data allowed per batch.
} `json:"config"`
L1GasPrice uint64 `json:"l1_gas_price"` // Current L1 gas price.
L1PubdataPrice uint64 `json:"l1_pubdata_price"` // Price of storing public data on L1.
// Represents the BaseToken<->ETH conversion ratio.
ConversionRation struct {
Denominator *big.Int `json:"denominator"` // Represents the denominator part of the conversion ratio.
Numerator *big.Int `json:"numerator"` // Represents the numerator part of the conversion ratio.
} `json:"conversion_ratio"`
L1GasPrice *big.Int `json:"l1_gas_price"` // Current L1 gas price.
L1PubdataPrice *big.Int `json:"l1_pubdata_price"` // Price of storing public data on L1.
} `json:"V2"`
}