Skip to content

Commit 68e1d35

Browse files
committed
Remove StateCompute and StateSimulate to be approached in #13028
To unblock progress in making incremental progress at v2 apis I am removing the implementation of StateSimulate and StateCompute in light of discussions at #13028.
1 parent 8fdb6ac commit 68e1d35

File tree

10 files changed

+4
-2114
lines changed

10 files changed

+4
-2114
lines changed

api/docgen/docgen.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ func init() {
478478
Input: ecchain,
479479
})
480480
addExample(types.TipSetSelectors.Finalized)
481-
addExample(types.TipSetLimits.Height(1413))
482481
}
483482

484483
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {

api/v2api/full.go

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/filecoin-project/go-address"
77

8-
"github.com/filecoin-project/lotus/api"
98
"github.com/filecoin-project/lotus/chain/types"
109
)
1110

@@ -99,61 +98,4 @@ type FullNode interface {
9998
//
10099
// Experimental: This API is experimental and may change without notice.
101100
StateGetID(context.Context, address.Address, types.TipSetSelector) (*address.Address, error) //perm:read
102-
103-
// StateCompute computes the state at the specified tipset and applies the provided messages.
104-
//
105-
// This function:
106-
// - Loads the tipset identified by the TipSetSelector
107-
// - Calculates the complete state by applying all chain messages within that tipset
108-
// - Applies the user-provided messages on top of that state
109-
// - Uses the network version of the selected tipset for message execution
110-
//
111-
// The function applies messages with the correct network parameters corresponding
112-
// to the tipset's epoch, making it suitable for testing messages against the
113-
// current network version.
114-
//
115-
// Messages must have the correct nonces and gas values set.
116-
//
117-
// The TipSetSelector parameter provides flexible options for selecting the base tipset:
118-
// - TipSetSelectors.Latest: the most recent tipset with the heaviest weight
119-
// - TipSetSelectors.Finalized: the most recent finalized tipset
120-
// - TipSetSelectors.Height(epoch, previous, anchor): tipset at the specified height
121-
// - TipSetSelectors.Key(key): tipset with the specified key
122-
//
123-
// See types.TipSetSelector documentation for additional details.
124-
//
125-
// Experimental: This API is experimental and may change without notice.
126-
StateCompute(context.Context, []*types.Message, types.TipSetSelector) (*api.ComputeStateOutput, error) //perm:read
127-
128-
// StateSimulate computes the state at the specified tipset and applies the provided messages
129-
// using the network version determined by a TipSetLimit.
130-
//
131-
// This function:
132-
// - Loads the tipset identified by the TipSetSelector
133-
// - Calculates the complete state by applying all chain messages within that tipset
134-
// - Applies any pending state upgrades up to the epoch determined by TipSetLimit
135-
// - Applies the user-provided messages on top of that state using the network version
136-
// corresponding to the target epoch
137-
//
138-
// This function is particularly useful for testing how messages would behave in
139-
// future network versions or for simulating execution at specific protocol versions.
140-
//
141-
// The TipSetLimit parameter controls the simulation target and must specify exactly
142-
// one of the following:
143-
// - Height: an absolute chain epoch at which to simulate execution
144-
// - Distance: a relative number of epochs ahead of the selected tipset
145-
//
146-
// For example, to simulate at exactly epoch 1000, use Height=1000. To simulate
147-
// 120 epochs ahead of the selected tipset, use Distance=120.
148-
//
149-
// If the target epoch determined by TipSetLimit is lower than the tipset's epoch,
150-
// an error will be returned as backward simulation is not supported.
151-
//
152-
// Messages must have the correct nonces and gas values set.
153-
//
154-
// The TipSetSelector parameter provides flexible options for selecting the base tipset.
155-
// See StateCompute and TipSetSelector documentation for details on selection options.
156-
//
157-
// Experimental: This API is experimental and may change without notice.
158-
StateSimulate(context.Context, []*types.Message, types.TipSetSelector, types.TipSetLimit) (*api.ComputeStateOutput, error) //perm:read
159101
}

api/v2api/proxy_gen.go

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v2api/v2mocks/mock_full.go

Lines changed: 0 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)