Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

- fix(eth): always return nil for eth transactions not found ([filecoin-project/lotus#12999](https://github.com/filecoin-project/lotus/pull/12999))
- feat: add experimental v2 APIs that are "F3 aware." (TODO: expand this section significantly to cover where someone learns about the new APIs, how they enable them, and what expectations they should have around them—i.e., they may change)
- feat: add gas to application metric reporting `vm/applyblocks_early_gas`, `vm/applyblocks_messages_gas`, `vm/applyblocks_cron_gas` ([filecoin-project/lotus#13030](https://github.com/filecoin-project/lotus/pull/13030))

# Node and Miner v1.32.2 / 2025-04-04

Expand Down
70 changes: 67 additions & 3 deletions build/openrpc/v2/full.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,73 @@
"schema": {
"examples": [
{
"Cids": null,
"Blocks": null,
"Height": 0
"Cids": [
{
"/": "bafy2bzacedo7hjsumaajt6sbor42qycvjyk6goqe4oi4o4ddsjxkdeqrqf42c"
}
],
"Blocks": [
{
"Miner": "f01938223",
"Ticket": {
"VRFProof": "rIPyBy+F827Szc5oN/6ylCmpzxfAWr7aI5F4YJrN4pLSyknkcJI3ivsCo2KKjQVZFRnFyEus1maD5LdzQpnFRKMla4138qEuML+Ne/fsgOMrUEAeL34ceVwJd+Mt4Jrz"
},
"ElectionProof": {
"WinCount": 1,
"VRFProof": "sN51JqjZNf+xWxwoo+wlMH1bpXI9T3wUIrla6FpwTxU4jC1z+ab5NFU/B2ZdDITTE+u8qaiibtLkld5lhNcOEOUqwKNyJ4nwFo5vAhWqvOTNdOiZmxsKpWG0NZUoXb/+"
},
"BeaconEntries": [
{
"Round": 17133822,
"Data": "tH4q8euIaP9/QRJt8ALfkBvttSmQ/DOAt8+37wGGV5f8kkhzEFrHhskitNnPS70j"
},
{
"Round": 17133832,
"Data": "uQD5cEn8U69+sPjpccT8Bm0jVrnXLScf2jBkLJNHvAHLA6tPsZDREzpBIckpVvPy"
}
],
"WinPoStProof": [
{
"PoStProof": 3,
"ProofBytes": "qOPLMhMui8qm/rE2y/UceyBDv5JvRCH5Fc5Ul+kuN190XDcMme5eKURUCmE2sN1HoQ2dMZX+xNZY351dbG93H/tUr6wuNhkvmemi2Xi62YvqU36/kJh+K2YBiW7h/4LXCUTP/6XAOONOPl+j9GqS7RQxruPLfIyehvzVC0C8dB8+SVWtAnRKRPUUOPJvyHKejlrCyzWXOz/I7JG2/qEGLD0xwazBVwML1vVvuE5NzXeOoQGlnB2PwSRb5Cn8FH8Q"
}
],
"Parents": [
{
"/": "bafy2bzaceba2kdmysmi5ieugzvv5np7f2lobayzpvtk777du74n7jq6xhynda"
},
{
"/": "bafy2bzacecrye24tkqrvvddcf62gfi4z4o33z2tdedbpaalordozaxfrz2jyi"
},
{
"/": "bafy2bzaceab5mrohjvnp3mz7mo33ky7qqlmssrs7veqmjrgouafxyhnd5dy66"
}
],
"ParentWeight": "116013147118",
"Height": 4863283,
"ParentStateRoot": {
"/": "bafy2bzaceajxzsvzuq3ddzxfrs2jlaxsooqmgdy5uxbqujnjy3y56iumzzy7u"
},
"ParentMessageReceipts": {
"/": "bafy2bzacecfcx2ykqucyv3gkyrcy3upwrvdraz3ktfg7phkqysefdwsggglac"
},
"Messages": {
"/": "bafy2bzacebzofmh6migvc4v6qsme6vuxlhi6pv2ocy4apyic3uihjqm7dum3u"
},
"BLSAggregate": {
"Type": 2,
"Data": "krFATGA0OBu/kFwtXsThVtKCkppnU7045uTURCeiOeJttxuXfx3wqJrLkCytnJFWFLVC+tiVWI4BxC3wqc9r6eAlNr9dEBx+3KwML/RFG/b5grmknLpGWn7g1EB/2T4y"
},
"Timestamp": 1744204890,
"BlockSig": {
"Type": 2,
"Data": "pWiUr+M8xxTxLED7GuU586gSfZCaHyLbLj0uS0HhKYRtHuyG47fIrfIT/04OCmQvEXBD8pFraWbMc3tnFrSsM1mIBJ5M38UPUfXDSspo+QGdouo2kll2X+VNKY3ajb1K"
},
"ForkSignaling": 0,
"ParentBaseFee": "20592036"
}
],
"Height": 4863283
}
],
"additionalProperties": false,
Expand Down
9 changes: 7 additions & 2 deletions chain/consensus/compute_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,13 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,

log.Infow("ApplyBlocks stats", "early", vmEarly, "earlyCronGas", earlyCronGas, "vmMsg", vmMsg, "msgGas", msgGas, "vmCron", vmCron, "cronGas", cronGas, "vmFlush", vmFlush, "epoch", epoch, "tsk", ts.Key())

stats.Record(ctx, metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))),
metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied))))
stats.Record(ctx,
metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))),
metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied))),
metrics.VMApplyEarlyGas.M(earlyCronGas),
metrics.VMApplyMessagesGas.M(msgGas),
metrics.VMApplyCronGas.M(cronGas),
)

return st, rectroot, nil
}
Expand Down
70 changes: 67 additions & 3 deletions documentation/en/api-v2-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,73 @@ Inputs:
Response:
```json
{
"Cids": null,
"Blocks": null,
"Height": 0
"Cids": [
{
"/": "bafy2bzacedo7hjsumaajt6sbor42qycvjyk6goqe4oi4o4ddsjxkdeqrqf42c"
}
],
"Blocks": [
{
"Miner": "f01938223",
"Ticket": {
"VRFProof": "rIPyBy+F827Szc5oN/6ylCmpzxfAWr7aI5F4YJrN4pLSyknkcJI3ivsCo2KKjQVZFRnFyEus1maD5LdzQpnFRKMla4138qEuML+Ne/fsgOMrUEAeL34ceVwJd+Mt4Jrz"
},
"ElectionProof": {
"WinCount": 1,
"VRFProof": "sN51JqjZNf+xWxwoo+wlMH1bpXI9T3wUIrla6FpwTxU4jC1z+ab5NFU/B2ZdDITTE+u8qaiibtLkld5lhNcOEOUqwKNyJ4nwFo5vAhWqvOTNdOiZmxsKpWG0NZUoXb/+"
},
"BeaconEntries": [
{
"Round": 17133822,
"Data": "tH4q8euIaP9/QRJt8ALfkBvttSmQ/DOAt8+37wGGV5f8kkhzEFrHhskitNnPS70j"
},
{
"Round": 17133832,
"Data": "uQD5cEn8U69+sPjpccT8Bm0jVrnXLScf2jBkLJNHvAHLA6tPsZDREzpBIckpVvPy"
}
],
"WinPoStProof": [
{
"PoStProof": 3,
"ProofBytes": "qOPLMhMui8qm/rE2y/UceyBDv5JvRCH5Fc5Ul+kuN190XDcMme5eKURUCmE2sN1HoQ2dMZX+xNZY351dbG93H/tUr6wuNhkvmemi2Xi62YvqU36/kJh+K2YBiW7h/4LXCUTP/6XAOONOPl+j9GqS7RQxruPLfIyehvzVC0C8dB8+SVWtAnRKRPUUOPJvyHKejlrCyzWXOz/I7JG2/qEGLD0xwazBVwML1vVvuE5NzXeOoQGlnB2PwSRb5Cn8FH8Q"
}
],
"Parents": [
{
"/": "bafy2bzaceba2kdmysmi5ieugzvv5np7f2lobayzpvtk777du74n7jq6xhynda"
},
{
"/": "bafy2bzacecrye24tkqrvvddcf62gfi4z4o33z2tdedbpaalordozaxfrz2jyi"
},
{
"/": "bafy2bzaceab5mrohjvnp3mz7mo33ky7qqlmssrs7veqmjrgouafxyhnd5dy66"
}
],
"ParentWeight": "116013147118",
"Height": 4863283,
"ParentStateRoot": {
"/": "bafy2bzaceajxzsvzuq3ddzxfrs2jlaxsooqmgdy5uxbqujnjy3y56iumzzy7u"
},
"ParentMessageReceipts": {
"/": "bafy2bzacecfcx2ykqucyv3gkyrcy3upwrvdraz3ktfg7phkqysefdwsggglac"
},
"Messages": {
"/": "bafy2bzacebzofmh6migvc4v6qsme6vuxlhi6pv2ocy4apyic3uihjqm7dum3u"
},
"BLSAggregate": {
"Type": 2,
"Data": "krFATGA0OBu/kFwtXsThVtKCkppnU7045uTURCeiOeJttxuXfx3wqJrLkCytnJFWFLVC+tiVWI4BxC3wqc9r6eAlNr9dEBx+3KwML/RFG/b5grmknLpGWn7g1EB/2T4y"
},
"Timestamp": 1744204890,
"BlockSig": {
"Type": 2,
"Data": "pWiUr+M8xxTxLED7GuU586gSfZCaHyLbLj0uS0HhKYRtHuyG47fIrfIT/04OCmQvEXBD8pFraWbMc3tnFrSsM1mIBJ5M38UPUfXDSspo+QGdouo2kll2X+VNKY3ajb1K"
},
"ForkSignaling": 0,
"ParentBaseFee": "20592036"
}
],
"Height": 4863283
}
```

34 changes: 32 additions & 2 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ import (
"github.com/filecoin-project/lotus/build/buildconstants"
)

// Distribution
var defaultMillisecondsDistribution = view.Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 3000, 4000, 5000, 7500, 10000, 20000, 50000, 100_000, 250_000, 500_000, 1000_000)
// Distributions
var defaultMillisecondsDistribution = view.Distribution(
0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, // Very short intervals for fast operations
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, // 10 ms intervals up to 100 ms
150, 200, 250, 300, 350, 400, 450, 500, // 50 ms intervals from 100 to 500 ms
600, 700, 800, 900, 1000, // 100 ms intervals from 500 to 1000 ms
1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, // 100 ms intervals from 1000 to 2000 ms
3000, 4000, 5000, 6000, 8000, 10000, 13000, 16000, 20000, 25000, 30000, 40000, 50000, 65000, 80000, 100000,
130_000, 160_000, 200_000, 250_000, 300_000, 400_000, 500_000, 650_000, 800_000, 1000_000, // Larger, less frequent buckets
)

var workMillisecondsDistribution = view.Distribution(
250, 500, 1000, 2000, 5000, 10_000, 30_000, 60_000, 2*60_000, 5*60_000, 10*60_000, 15*60_000, 30*60_000, // short sealing tasks
40*60_000, 45*60_000, 50*60_000, 55*60_000, 60*60_000, 65*60_000, 70*60_000, 75*60_000, 80*60_000, 85*60_000, 100*60_000, 120*60_000, // PC2 / C2 range
Expand Down Expand Up @@ -114,6 +123,9 @@ var (
VMApplyEarly = stats.Float64("vm/applyblocks_early", "Time spent in early apply-blocks (null cron, upgrades)", stats.UnitMilliseconds)
VMApplyCron = stats.Float64("vm/applyblocks_cron", "Time spent in cron", stats.UnitMilliseconds)
VMApplyFlush = stats.Float64("vm/applyblocks_flush", "Time spent flushing vm state", stats.UnitMilliseconds)
VMApplyMessagesGas = stats.Int64("vm/applyblocks_messages_gas", "Total gas of block messages", stats.UnitDimensionless)
VMApplyEarlyGas = stats.Int64("vm/applyblocks_early_gas", "Total gas of early apply-blocks (null cron, upgrades)", stats.UnitDimensionless)
VMApplyCronGas = stats.Int64("vm/applyblocks_cron_gas", "Total gas of cron", stats.UnitDimensionless)
VMSends = stats.Int64("vm/sends", "Counter for sends processed by the VM", stats.UnitDimensionless)
VMApplied = stats.Int64("vm/applied", "Counter for messages (including internal messages) processed by the VM", stats.UnitDimensionless)
VMExecutionWaiting = stats.Int64("vm/execution_waiting", "Counter for VM executions waiting to be assigned to a lane", stats.UnitDimensionless)
Expand Down Expand Up @@ -399,6 +411,21 @@ var (
Aggregation: defaultMillisecondsDistribution,
TagKeys: []tag.Key{Network},
}
VMApplyEarlyGasView = &view.View{
Measure: VMApplyEarlyGas,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{Network},
}
VMApplyMessagesGasView = &view.View{
Measure: VMApplyMessagesGas,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{Network},
}
VMApplyCronGasView = &view.View{
Measure: VMApplyCronGas,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{Network},
}
VMSendsView = &view.View{
Measure: VMSends,
Aggregation: view.LastValue(),
Expand Down Expand Up @@ -788,6 +815,9 @@ var ChainNodeViews = append([]*view.View{
VMApplyEarlyView,
VMApplyCronView,
VMApplyFlushView,
VMApplyEarlyGasView,
VMApplyMessagesGasView,
VMApplyCronGasView,
VMSendsView,
VMAppliedView,
VMExecutionWaitingView,
Expand Down