Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

Commit 4e04f6d

Browse files
chore: add tracers stubs (#222)
While all other stubs were present in `temporary.go`, these two methods were missing. This sets up the config, and makes clear all the RPC methods that still need to be implemented.
1 parent 8e985d2 commit 4e04f6d

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

sae/rpc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/ava-labs/libevm/core/types"
2424
"github.com/ava-labs/libevm/crypto"
2525
"github.com/ava-labs/libevm/eth/filters"
26+
"github.com/ava-labs/libevm/eth/tracers"
2627
"github.com/ava-labs/libevm/ethdb"
2728
"github.com/ava-labs/libevm/event"
2829
"github.com/ava-labs/libevm/libevm/debug"
@@ -38,6 +39,7 @@ import (
3839
// APIBackend is the union of all interfaces required to implement the SAE APIs.
3940
type APIBackend interface {
4041
ethapi.Backend
42+
tracers.Backend
4143
filters.BloomOverrider
4244
}
4345

@@ -173,6 +175,13 @@ func (vm *VM) ethRPCServer() (*rpc.Server, error) {
173175
})
174176
}
175177

178+
if !vm.config.RPCConfig.DisableTracing {
179+
apis = append(apis, api{
180+
// Geth-specific APIs:
181+
"debug", tracers.NewAPI(b),
182+
})
183+
}
184+
176185
s := rpc.NewServer()
177186
for _, api := range apis {
178187
if err := s.RegisterName(api.namespace, api.api); err != nil {

sae/temporary.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import (
1212
"math/big"
1313

1414
"github.com/ava-labs/libevm/common"
15+
"github.com/ava-labs/libevm/core"
16+
"github.com/ava-labs/libevm/core/state"
1517
"github.com/ava-labs/libevm/core/types"
18+
"github.com/ava-labs/libevm/core/vm"
19+
"github.com/ava-labs/libevm/eth/tracers"
1620
"github.com/ava-labs/libevm/rpc"
1721
)
1822

@@ -37,3 +41,11 @@ func (b *ethAPIBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts)
3741
func (b *ethAPIBackend) GetPoolNonce(context.Context, common.Address) (uint64, error) {
3842
panic(errUnimplemented)
3943
}
44+
45+
func (b *ethAPIBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, readOnly bool, preferDisk bool) (*state.StateDB, tracers.StateReleaseFunc, error) {
46+
panic(errUnimplemented)
47+
}
48+
49+
func (b *ethAPIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (*core.Message, vm.BlockContext, *state.StateDB, tracers.StateReleaseFunc, error) {
50+
panic(errUnimplemented)
51+
}

sae/vm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ type RPCConfig struct {
9191
BlocksPerBloomSection uint64
9292
EnableDBInspecting bool
9393
EnableProfiling bool
94+
DisableTracing bool
9495
EVMTimeout time.Duration
9596
GasCap uint64
9697
}

0 commit comments

Comments
 (0)