voting

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package voting is the TRC voting application: the resident application a founding core hosts for the cores of its ISD to submit TRC updates on. A core that enrolled as a normal node submits the successor it assembled and signed — its proofs of possession, and its own vote when it rolls by regular update — and the application hands the submission to the control plane's decision, which pins what verifies as submitted and casts the founder's sensitive vote itself where the update needs it: the application decides nothing, and the control plane serves no submission of its own. Nothing else depends on the application — the network serves the drafts' control plane, enrollment, and paths with or without it — and a joining core whose founder hosts none stops itself rather than wait, for no voting power can be obtained that way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the voting application: its submission service mounted on the control endpoint, every submission identified by the verified chain of the channel it arrived on and handed to the control plane's decision.

func New

func New(cfg Config) *App

New mounts the application's submission service on the control endpoint: the service registered on a connect server, which connecthttp.Mount spreads over a private mux mounted at the service name's canonical pattern.

func (*App) Close

func (a *App) Close()

Close releases the application; the endpoint releases its mount.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run serves until the context is canceled: the control endpoint serves the mounted submission service, so the application runs no loop of its own.

type Config

type Config struct {
	// IA is the node's ISD-AS.
	IA addr.IA
	// Decide is the control plane's decision the submissions are handed
	// to: the founding core's, the one role the application loads on.
	Decide Decider
	// MountControlEndpoint mounts one of the application's handlers on the
	// node's control endpoint, behind the peer-identity middleware.
	MountControlEndpoint func(pattern string, handler http.Handler)
}

Config configures the voting application.

type Decider

type Decider interface {
	DecideTRC(ctx context.Context, presenter addr.IA, source netip.AddrPort,
		trc cppki.SignedTRC) (cppki.SignedTRC, error)
}

Decider is the decision the submissions are handed to: the control plane's own update of the pinned TRC — the founder asking its gates, pinning what verifies as submitted, and casting its sensitive vote on its admission policy's allow — answered with the TRC it pinned. The presenter is the ISD-AS the application's channel verified, never a claim, and the source is the address the submission arrived from.

type Submitter

type Submitter struct {
	// contains filtered or unexported fields
}

Submitter sends TRC update submissions to the core's voting application over the node's verified peer channel — the node's chain presented, the core's verified against the pinned TRC — so the submission arrives identified by the chain the decision gates on and names to its admission policy.

func NewSubmitter

func NewSubmitter(hclt *http.Client, founderRoute func() *scion.Addr) *Submitter

NewSubmitter builds the submitter over the verified peer channel.

func (*Submitter) SubmitTRC

func (s *Submitter) SubmitTRC(
	ctx context.Context,
	trc cppki.SignedTRC,
) (cppki.SignedTRC, error)

SubmitTRC hands the signed successor to the core's voting application and answers with the TRC its control plane pinned. A submission nothing answers — the endpoint replies that no such application is mounted — is the core hosting no voting application, the terminal condition the caller stops the node on.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL