Skip to content

Commit f27a7e9

Browse files
authored
fix(api) eth_getTransactionCount operate on current tipset state (#13275)
* fix eth_getTransactionCount tipset * update CHANGELOG.md * update changelog, one PR per line
1 parent aa6929b commit f27a7e9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# UNRELEASED
1111
- feat(net): add LOTUS_ENABLE_MESSAGE_FETCH_INSTRUMENTATION=1 to turn on metrics and debugging for local vs bitswap message fetching during block validation ([filecoin-project/lotus#13221](https://github.com/filecoin-project/lotus/pull/13221))
1212
- chore(docs): mark v0 API as "deprecated" and v1 as "stable" ([filecoin-project/lotus#13264](https://github.com/filecoin-project/lotus/pull/13264))
13-
- fix(api): `eth_getCode` and `eth_getStorageAt` now return state after the specified block rather than before it ([filecoin-project/lotus#13247](https://github.com/filecoin-project/lotus/issues/13247))
13+
- fix(api): `eth_getCode` and `eth_getStorageAt` now return state after the specified block rather than before it ([filecoin-project/lotus#13274](https://github.com/filecoin-project/lotus/pull/13274))
14+
- fix(api): `eth_getTransactionCount` now returns state after the specified block rather than before it ([filecoin-project/lotus#13275](https://github.com/filecoin-project/lotus/pull/13275))
1415

1516

1617
# Node v1.33.1 / 2025-07-31

node/impl/eth/transaction.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,13 @@ func (e *ethTransaction) EthGetTransactionCount(ctx context.Context, sender etht
261261
return ethtypes.EthUint64(0), err // don't wrap, to preserve ErrNullRound
262262
}
263263

264+
stateCid, _, err := e.stateManager.TipSetState(ctx, ts)
265+
if err != nil {
266+
return 0, err
267+
}
268+
264269
// Get the actor state at the specified tipset
265-
actor, err := e.stateManager.LoadActor(ctx, addr, ts)
270+
actor, err := e.stateManager.LoadActorRaw(ctx, addr, stateCid)
266271
if err != nil {
267272
if errors.Is(err, types.ErrActorNotFound) {
268273
return 0, nil

0 commit comments

Comments
 (0)