Skip to content

Commit

Permalink
feat: support fractional gas cost for calldata
Browse files Browse the repository at this point in the history
  • Loading branch information
dartdart26 committed Nov 3, 2023
1 parent 973539b commit 509097c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fhevm/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,11 @@ var (
FheUint8TrivialEncryptGas uint64 = 100
FheUint16TrivialEncryptGas uint64 = 200
FheUint32TrivialEncryptGas uint64 = 400

// A byte of data attached to a transaction has fractional cost: 1 / TxDataFractionalGasFactor.
TxDataFractionalGasFactor uint64 = 4
)

func TxDataFractionalGas(originalGas uint64) (fractionalGas uint64) {
return originalGas / TxDataFractionalGasFactor
}

0 comments on commit 509097c

Please sign in to comment.