Skip to content

Commit

Permalink
Merge pull request #5354 from oasisprotocol/peternose/feature/propose…
Browse files Browse the repository at this point in the history
…r-backup

go/worker/compute/executor/committee: Support backup proposers
  • Loading branch information
peternose authored Oct 5, 2023
2 parents 6723ffd + 2a53cf8 commit 6bbae8f
Show file tree
Hide file tree
Showing 83 changed files with 4,571 additions and 4,589 deletions.
7 changes: 7 additions & 0 deletions .changelog/5354.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
go/worker/compute/executor/committee: Support backup proposers

Starting now, all executor committee workers are permitted to schedule
transactions, each with distinct per-round priority. Priority dictates
the time after which a worker can propose a new batch. The consensus
layer tracks all published executor commitments and tries to build
a new runtime block on a proposal with the highest priority.
2 changes: 1 addition & 1 deletion docs/oasis-node/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ node):
"batch_flush_timeout": 1000000000,
"max_batch_size": 100,
"max_batch_size_bytes": 1048576,
"propose_batch_timeout": 2
"propose_batch_timeout": 2000000000
},
"storage": {
"group_size": 3,
Expand Down
12 changes: 6 additions & 6 deletions docs/oasis-node/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ oasis_txpool_pending_schedule_size | Gauge | Size of the main schedulable queue
oasis_txpool_rejected_transactions | Counter | Number of rejected transactions (failing check tx). | runtime | [runtime/txpool](https://github.com/oasisprotocol/oasis-core/tree/master/go/runtime/txpool/metrics.go)
oasis_txpool_rim_queue_size | Gauge | Size of the roothash incoming message transactions schedulable queue (number of entries). | runtime | [runtime/txpool](https://github.com/oasisprotocol/oasis-core/tree/master/go/runtime/txpool/metrics.go)
oasis_up | Gauge | Is oasis-test-runner active for specific scenario. | | [oasis-node/cmd/common/metrics](https://github.com/oasisprotocol/oasis-core/tree/master/go/oasis-node/cmd/common/metrics/metrics.go)
oasis_worker_aborted_batch_count | Counter | Number of aborted batches. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_batch_processing_time | Summary | Time it takes for a batch to finalize (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_batch_runtime_processing_time | Summary | Time it takes for a batch to be processed by the runtime (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_batch_size | Summary | Number of transactions in a batch. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_aborted_batch_count | Counter | Number of aborted batches. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_batch_processing_time | Summary | Time it takes for a batch to finalize (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_batch_runtime_processing_time | Summary | Time it takes for a batch to be processed by the runtime (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_batch_size | Summary | Number of transactions in a batch. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_epoch_number | Gauge | Current epoch number as seen by the worker. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_epoch_transition_count | Counter | Number of epoch transitions. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_execution_discrepancy_detected_count | Counter | Number of detected execute discrepancies. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_execution_discrepancy_detected_count | Counter | Number of detected execute discrepancies. | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_executor_committee_p2p_peers | Gauge | Number of executor committee P2P peers. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_executor_is_backup_worker | Gauge | 1 if worker is currently an executor backup worker, 0 otherwise. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_executor_is_worker | Gauge | 1 if worker is currently an executor worker, 0 otherwise. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
Expand Down Expand Up @@ -128,7 +128,7 @@ oasis_worker_node_status_runtime_faults | Gauge | Number of runtime faults. | ru
oasis_worker_node_status_runtime_suspended | Gauge | Runtime node suspension status (binary). | runtime | [worker/registration](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/registration/worker.go)
oasis_worker_processed_block_count | Counter | Number of processed roothash blocks. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_processed_event_count | Counter | Number of processed roothash events. | runtime | [worker/common/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/common/committee/node.go)
oasis_worker_storage_commit_latency | Summary | Latency of storage commit calls (state + outputs) (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/node.go)
oasis_worker_storage_commit_latency | Summary | Latency of storage commit calls (state + outputs) (seconds). | runtime | [worker/compute/executor/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/compute/executor/committee/metrics.go)
oasis_worker_storage_full_round | Gauge | The last round that was fully synced and finalized. | runtime | [worker/storage/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/storage/committee/metrics.go)
oasis_worker_storage_pending_round | Gauge | The last round that is in-flight for syncing. | runtime | [worker/storage/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/storage/committee/metrics.go)
oasis_worker_storage_round_sync_latency | Summary | Storage round sync latency (seconds). | runtime | [worker/storage/committee](https://github.com/oasisprotocol/oasis-core/tree/master/go/worker/storage/committee/metrics.go)
Expand Down
5 changes: 3 additions & 2 deletions go/consensus/cometbft/apps/registry/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package registry

import (
"testing"
"time"

requirePkg "github.com/stretchr/testify/require"

Expand Down Expand Up @@ -806,10 +807,10 @@ func TestRegisterRuntime(t *testing.T) {
RoundTimeout: 5,
},
TxnScheduler: registry.TxnSchedulerParameters{
BatchFlushTimeout: 100_000_000,
BatchFlushTimeout: time.Second,
MaxBatchSize: 100,
MaxBatchSizeBytes: 100_000_000,
ProposerTimeout: 2,
ProposerTimeout: 2 * time.Second,
},
Deployments: []*registry.VersionInfo{
{
Expand Down
41 changes: 41 additions & 0 deletions go/consensus/cometbft/apps/roothash/api/block.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package api

import (
"bytes"
"sort"

"github.com/oasisprotocol/oasis-core/go/common"
abciAPI "github.com/oasisprotocol/oasis-core/go/consensus/cometbft/api"
)

// finalizationPendingRuntimesKey is the block context key.
type finalizationPendingRuntimesKey struct{}

func (pk finalizationPendingRuntimesKey) NewDefault() interface{} {
return make(map[common.Namespace]struct{})
}

// RegisterRuntimeForFinalization appends the given runtime to the list of runtimes considered
// for finalization during the end block.
func RegisterRuntimeForFinalization(ctx *abciAPI.Context, runtimeID common.Namespace) {
rts := ctx.BlockContext().Get(finalizationPendingRuntimesKey{}).(map[common.Namespace]struct{})

rts[runtimeID] = struct{}{}
}

// RuntimesToFinalize returns an ordered list of runtimes to be considered for finalization
// during the end block.
func RuntimesToFinalize(ctx *abciAPI.Context) []common.Namespace {
rts := ctx.BlockContext().Get(finalizationPendingRuntimesKey{}).(map[common.Namespace]struct{})

// Ensure deterministic order of runtimes.
sorted := make([]common.Namespace, 0, len(rts))
for id := range rts {
sorted = append(sorted, id)
}
sort.Slice(sorted, func(i, j int) bool {
return bytes.Compare(sorted[i][:], sorted[j][:]) < 0
})

return sorted
}
Loading

0 comments on commit 6bbae8f

Please sign in to comment.