Skip to content

Commit

Permalink
up gas again, log pair hash
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Dec 18, 2024
1 parent e1cff6a commit 033f50f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (st *StateTransition) preCheck() error {
// However if any consensus issue encountered, return the error directly with
// nil evm execution result.
func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
// if this is a injected tx, we only need to mint funds and no gas is used.
// if this is a injected tx with no data, it's a native token mint.
if st.msg.IsInjectedTx && len(st.msg.Data) == 0 {
log.Debug("deposit tx minting funds", "to", *st.msg.To, "value", st.msg.Value)
st.state.AddBalance(*st.msg.To, uint256.MustFromBig(st.msg.Value), tracing.BalanceIncreaseAstriaInjectedTx)
Expand All @@ -405,7 +405,6 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
if st.msg.IsInjectedTx {
st.initialGas = st.msg.GasLimit
st.gasRemaining = st.msg.GasLimit
log.Debug("deposit tx minting erc20", "to", *st.msg.To, "value", st.msg.Value)
}

// First check this message satisfies all consensus rules before
Expand Down
7 changes: 4 additions & 3 deletions grpc/execution/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package execution
import (
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"math/big"

Expand Down Expand Up @@ -103,15 +104,15 @@ func validateAndConvertOracleDataTx(
txdata := types.InjectedTx{
From: cfg.oracleCallerAddress,
Value: new(big.Int),
Gas: 10000,
Gas: 100000,
To: &cfg.oracleContractAddress,
Data: calldata,
SourceTransactionId: primitivev1.TransactionId{},
SourceTransactionIndex: 0,
}
tx := types.NewTx(&txdata)
txs = append(txs, tx)
log.Debug("created initializeCurrencyPair tx for currency pair", "pair", price.CurrencyPair)
log.Debug("created initializeCurrencyPair tx for currency pair", "pair", price.CurrencyPair, "hash", hex.EncodeToString(currencyPairs[i][:]))
}

args := []interface{}{currencyPairs, prices}
Expand All @@ -124,7 +125,7 @@ func validateAndConvertOracleDataTx(
From: cfg.oracleCallerAddress,
Value: new(big.Int),
// TODO: max gas costs; proportional to the amount of pairs being updated
Gas: 500000,
Gas: 900000,
To: &cfg.oracleContractAddress,
Data: calldata,
SourceTransactionId: primitivev1.TransactionId{}, // not relevant
Expand Down

0 comments on commit 033f50f

Please sign in to comment.