settings

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxInstructionSize     = 100 * 1024       // 100 KB
	MaxActionSize          = 10 * 1024 * 1024 // 10 MB
	MaxFetchResponseSize   = 10 * 1024 * 1024 // 10 MB - limits the total size of a fetched action response
	MaxVariableMessageSize = 1024 * 1024      // 1 MB - limits the total size of all aggregated variable messages
	MaxVariableMessages    = 200              // Maximum number of per-signer variable messages (and signatures/timestamps) in an action. Bounds per-entry work like decrypt on restore.

	MaxWallets                = 200_000          // Maximum number of wallets that can be stored in memory. This is a safety limit to prevent OOM errors.
	MaxPermanentWalletsStatus = 1_000_000        // Maximum number of wallets that can be stored in permanent storage. This is a safety limit to prevent OOM errors.
	MaxSignGoroutines         = 3000             // Maximum number of concurrent XRP sign schedule goroutines. Prevents OOM from accumulated sleeping goroutines.
	MaxFeeEntries             = 50               // Maximum number of fee schedule entries per XRP sign instruction.
	MaxFeeScheduleTime        = 10 * time.Minute // Maximum delay allowed in a fee schedule entry.
)
View Source
const (
	SetProxyURLEndpoint = "/proxy"
	ProxyURLEnvVar      = "PROXY_URL"

	SetInitialOwnerEndpoint = "/initial-owner"
	InitialOwnerEnvVar      = "INITIAL_OWNER"

	SetExtensionIDEndpoint = "/extension-id"
	ExtensionIDEnvVar      = "EXTENSION_ID"
)
View Source
const EncodingVersion = "1.0.0"
View Source
const ProxyTimeout = 2 * time.Second

Variables

View Source
var (
	// Modes:
	// - 0 production,
	// - 1 local (no attestation)
	Mode     = 1
	LogLevel = "FATAL"

	ConfigPort    = 5500 // For node configuration.
	SignPort      = 8888 // For signing action results received from extensions.
	ExtensionPort = 8889 // Extension's port that accepts actions.

	TestPlatform, _ = convert.StringToCommonHash("TEST_PLATFORM")
	TestCodeHash    = common.HexToHash("194844cf417dde867073e5ab7199fa4d21fd82b5dbe2bdea8b3d7fc18d10fdc2")

	DefaultExtensionID = common.MaxHash
)
View Source
var ActionDrainTimeout = 5 * time.Second

ActionDrainTimeout bounds how long the queue worker waits for an in-flight processor to return after its context has been cancelled. Cooperative processors unwind well within this window. If a processor doesn't return in time the worker abandons it (the goroutine continues running but its result is discarded) and returns a state-unknown error so the queue keeps moving — accepting the leak as the lesser evil compared to wedging the queue forever.

Declared as var (not const) so tests can shrink it; production code only reads it.

View Source
var ActionProcessTimeout = 10 * time.Second

ActionProcessTimeout bounds the synchronous per-action processing time. When exceeded the action's context is cancelled so cancellation-aware processors short-circuit before committing state.

Declared as var (not const) so tests can shrink it for fast cancellation assertions; production code only reads it.

View Source
var QueuedActionsPauseTime = 100 * time.Millisecond
View Source
var QueuedActionsSleepTime = 2 * time.Second

Processor configuration

Functions

This section is empty.

Types

type ConfigServer

type ConfigServer struct {
	ProxyURL *ProxyURLMutex
	// contains filtered or unexported fields
}

func NewConfigServer

func NewConfigServer(port int, configurer Configurer) *ConfigServer

NewConfigServer creates an HTTP server that accepts proxy configuration requests on the provided port and exposes the configured URL via ProxyURL.

func (*ConfigServer) Close

func (pc *ConfigServer) Close(ctx context.Context) error

Close gracefully shuts down the proxy configuration server.

func (*ConfigServer) Serve

func (pc *ConfigServer) Serve() error

Serve starts the proxy configuration server and blocks until it stops.

type Configurer

type Configurer interface {
	SetOwner(common.Address) error
	SetExtensionID(common.Hash) error
}

type ProxyURLMutex

type ProxyURLMutex struct {
	URL string

	sync.RWMutex
}

Jump to

Keyboard shortcuts

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