Skip to content
Draft
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
7 changes: 7 additions & 0 deletions ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import (
"github.com/Fantom-foundation/go-opera/opera"
"github.com/Fantom-foundation/go-opera/utils/adapters/ethdb2kvdb"
"github.com/Fantom-foundation/go-opera/utils/dbutil/compactdb"
"github.com/Fantom-foundation/go-opera/utils/dbutil/threads"
"github.com/Fantom-foundation/go-opera/utils/signers/gsignercache"
"github.com/Fantom-foundation/go-opera/utils/signers/internaltx"
)
Expand Down Expand Up @@ -948,6 +949,12 @@ func (diff *StateOverride) Apply(state *state.StateDB) error {
}

func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*evmcore.ExecutionResult, error) {
got, release := threads.GlobalPool.Lock(1)
defer release(got)
if got < 1 {
return nil, errors.New("Thread exhaustion. Try later.")
}

defer func(start time.Time) { log.Debug("Executing EVM call finished", "runtime", time.Since(start)) }(time.Now())

state, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
Expand Down