The Interfold 백서

The Interfold

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 45쪽 중 24쪽

lfilled Randomness provider The provider recorded a VRF response. RandomnessCircuitBreakerTripped CiphernodeRegistry The VRF wait expired without a usable response. CommitteeBondOwnerCapEnabled CiphernodeRegistry The E3 gives at most one seat to each snapshot bond owner. TicketSubmitted CiphernodeRegistry A ciphernode submitted a ticket. SortitionCommitteeFinalized CiphernodeRegistry The committee is final. CommitteeFormationFailed CiphernodeRegistry Fewer than N bond owners submitted eligible tickets. CommitteePublished CiphernodeRegistry The committee published the aggregated public key. Log lines The node writes these lines at the INFO level, so start it with -v or more to see them. The ERROR line appears at every verbosity level. Log line Meaning Waiting for the delayed sortition seed The E3 is known, but the VRF seed is not available yet. Ranking bond owners and their fallback operators for ticket submission Local selection started for an E3. Node is not active The operator was not active at the snapshot. Node has no tickets in the request-time sortition view The snapshot balance gives 0 tickets. This node was SELECTED for sortition The node has a candidate ticket to submit. This node was NOT selected for sortition The node is not eligible, has no free capacity, or its owner is not ranked. Ticket generated for score sortition The node sends its best ticket to the chain writer. Ticket submitted to registry The submitTicket transaction succeeded. Failed to submit ticket: … ( ERROR ) The submitTicket transaction failed. The message includes the decoded error. Node is in finalized committee, emitting CiphernodeSelected The node has a seat and starts the DKG. Node not in finalized committee The node submitted, but another bond owner took the seat. For problems with selection, read Troubleshooting . Next steps Manage tickets Buy, check, and redeem tickets with the CLI or a wallet. Procedure Sortition internals The seed, the scoring function, and the finalization rules in detail. Internals Exits and slashing Rewards, slash penalties on tickets and bonds, and the exit queue. Maintain Registration & Bonding Manage Tickets ## /operate/manage-tickets Run a Ciphernode Manage Tickets Manage Tickets This page gives the procedures to buy, check, and redeem the tickets of a ciphernode. It is for the bond owner of a registered operator. At the end, you can change the ticket balance with the CLI or with contract calls, and you know which errors stop each step. For the concepts behind tickets, read Tickets and sortition . For every flag, see interfold ciphernode tickets . Before you start You need these items: A registered operator. addTicketBalanceFor reverts with NotRegistered before registration. See Registration . The bond owner wallet, with the ticket collateral and ETH for gas. For the CLI: an interfold configuration whose wallet is the bond owner. The examples use /path/to/owner.yaml . The ticket commands send each transaction from the wallet of the configuration. The --operator flag selects the operator position. If the operator is its own bond owner, use the node configuration and omit --operator . The CLI then uses the address of the configured wallet. If the bond owner is a Safe, use the contract calls through the Safe interface. On Sepolia, the fee token and the ticket collateral are the same token: MockUSDC , a test USDC that anyone can mint. The faucet sends tokens to the wallet of the configuration, so use the bond-owner configuration: interfold --config /path/to/owner.yaml faucet --chain sepolia . One call gives 1000 USDC and 1000 FOLD, which is enough for the 100 FOLD Sepolia bond. You can also call faucet() on the Faucet contract from the bond owner, or call mint on MockUSDC . The --amount values are token amounts, not ticket counts. tickets buy takes an amount of ticket collateral. tickets burn takes an amount of tFOLD. The CLI converts the value with the decimals of the token, so --amount 1000 means 1,000 whole tokens. Check the ticket balance Run the status command for the operator: interfold ciphernode status --operator 0 xOPERATOR Add --chain <name> when the configuration has more than one chain. Without --chain , the CLI uses the first chain entry. The output has this format: Ciphernode status on mainnet: Operator key: 0xOPERATOR Bond owner: 0xBOND_OWNER Registered: true Active: true Exit pending: false Ticket balance: 2000 (2 available) Ciphernode bond: 32000 Pending exits: tickets=0, bond=0 Requirements: minTickets=1, ticketPrice=1000 tFOLD, ciphernodeBond=32000 FOLD Committees: none Field Meaning Ticket balance The tFOLD balance in token units. The number in parentheses is availableTickets . Active The result of isActive(operator) . See When a ciphernode is active . Exit pending true while a deregistration waits for its exit delay. Pending exits Ticket collateral and FOLD in the exit queue that the bond owner did not claim yet. Requirements The live minTicketBalance , ticketPrice , and requiredCiphernodeBond . Committees The committees that hold the collateral until releaseCommittee(e3Id) . Each line shows the E3 ID, the membership, and the E3 stage. The ticket and exit values are also available from BondingRegistry with getTicketBalance(operator) , availableTickets(operator) , pendingExits(operator) , and previewClaimable(operator) . For the balance that an E3 used, call getTicketBalanceAtBlock(operator, timepoint) with the requestBlock - 1 timepoint of that E3. Buy tickets To calculate the deposit, multiply the number of tickets by ticketPrice . For example, 2 tickets on mainnet at 1,000 sUSDS shares each need a deposit of 2,000 sUSDS shares. A remainder below one ticketPrice stays in the balance but does not give a ticket. CLI Contract calls Read the ticket price Run interfold ciphernode status --operator 0xOPERATOR . Read ticketPrice in the Requirements line. Deposit the collateral Run the buy command from the bond owner configuration: interfold --config /path/to/owner.yaml ciphernode tickets \ --operator 0 xOPERATOR buy --amount 2000 The CLI reads the ticket token and its collateral token from BondingRegistry . If the allowance is too low, the CLI first approves the ticket token contract for the amount. Then it calls addTicketBalanceFor(operator, amount) . The output shows the new ticket count, read back from the chain: Deposited 2000 <SYMBOL> for operator 0xOPERATOR. Ticket balance is now 2 tickets (tx: 0x…) Verify the status Run interfold ciphernode status --operator 0xOPERATOR . Make sure that Active is true and that the available ticket count is correct. Send both transactions from the bond owner wallet or Safe. Get the addresses from Contracts and addresses , or read them from BondingRegistry with getTicketToken() and from the ticket token with underlying() . Approve the ticket token On the collateral token, call approve(<InterfoldTicketToken>, amount) . The spender is the ticket token contract, not BondingRegistry . The ticket token pulls the collateral during the deposit. Add the ticket balance On BondingRegistry , call addTicketBalanceFor(operator, amount) . The registry emits TicketBalanceUpdated with the reason DEPOSIT . If the operator becomes active, it also emits OperatorActivationChanged . Verify the status Run interfold ciphernode status --operator 0xOPERATOR , or call availableTickets(operator) . The Buy tickets step of the hosted operator guide (opens in a new tab) sends the same two transactions from a browser wallet. It calculates the amount from the number of tickets that you enter. Redeem tickets A redemption has three parts. The burn removes the tickets at once. The collateral then waits in the exit queue for exitDelay . After the delay, a claim pays the collateral to the bond owner. ⚠️ A burn takes effect in the same transaction and you cannot cancel it. If the balance drops below minTicketBalance , the operator becomes inactive and cannot enter new committees. The collateral in the exit queue stays slashable until the claim. Burn the tickets Run the burn command from the bond owner configuration. The amount is in tFOLD units: interfold --config /path/to/owner.yaml ciphernode tickets \ --operator 0 xOPERATOR burn --amount 1000 The CLI calls removeTicketBalanceFor(operator, amount) . The registry burns the tFOLD and queues the same amount of collateral for exitDelay seconds. The output shows the new ticket count: Burned 1000 tFOLD from operator 0xOPERATOR. Ticket balance is now 1 tickets (tx: 0x…) interfold ciphernode deactivate --tickets <amount> sends the same transaction. Wait for the exit delay Run interfold ciphernode status --operator 0xOPERATOR to see the Pending exits amounts. To see the amount that is ready now, call previewClaimable(operator) on BondingRegistry . Claim the collateral Run the claim command: interfold --config /path/to/owner.yaml ciphernode bond \ --operator 0 xOPERATOR claim --max-bond 0 --max-bond 0 claims only ticket collateral. Any account can send this claim, and the collateral always goes to the bond owner. Without --max-ticket and --max-bond , the command claims all the unlocked ticket collateral and FOLD, and only the bond owner can send it. The output is Claimed exits for operator 0xOPERATOR (tx: 0x…) . The contract call for the claim is claimExitsFor(operator, maxTicketAmount, maxCiphernodeBondAmount) on BondingRegistry . To claim everything with a contract call, the bond owner sets both maximums to the largest uint256 value. Keep the balance healthy Deposit before demand. An E3 uses the balance at requestBlock - 1 . A deposit counts only for E3s that are requested after the deposit block. Keep a margin above the minimum. A ticket slash burns tFOLD from the active balance first. A governance increase of ticketPrice also reduces the ticket count of the same collateral. Either change can make the operator inactive. Match tickets to capacity. The node takes part in at most one E3 for each ticket at the same time. More tickets let the node serve more E3s in parallel, so the host needs the resources for them. See Requirements . Watch the events. TicketBalanceUpdated reports each balance change, and OperatorActivationChanged reports each change of the active status. Errors Error Cause Action NotRegistered The operator is not registered. Register the operator first. NotBondOwner(caller, operator) The wallet that sent the transaction is not the bond owner. Use the bond owner configuration or wallet. ExitInProgress A deregistration waits for its exit delay. Wait until the exit delay ends. OperatorUnderSlash A slash proposal against the operator is open. Wait until the proposal is executed, cancelled, or expired. InsufficientBalance The burn amount is larger than the tFOLD balance. Burn a smaller amount. ZeroAmount The amount is 0. Use an amount larger than 0. ExitNotReady No queued amount is unlocked yet. Wait for the exit delay, then claim again. OperatorInActiveCommittee The operator is on a committee whose E3 is not terminal yet. Wait until the E3 completes or fails and the committee is released. Fractional precision exceeds token decimals The CLI amount has more decimal places than the token. Use fewer decimal places. Next steps Tickets and sortition How the ticket balance at the request time feeds committee selection. Concepts Node dashboard See the ticket balance and the active status of the node in a browser. Monitor Exits and slashing Leave the network, claim collateral, and respond to a slash proposal. Maintain Tickets and Sortition Node Dashboard ## /operate/dashboard Run a Ciphernode Node Dashboard Node Dashboard The Interfold has two dashboards. The local node dashboard runs inside your ciphernode process and shows what that node knows. The hosted dashboard is a public web app that reads the chain. This page is for operators who monitor a ciphernode. At the end, you can enable the local dashboard and open it safely from another computer. You can also read its JSON API, send alerts from it, and you know when to use the hosted dashboard. Dashboard Where it runs Data source Use it to Local dashboard In the interfold start process, on 127.0.0.1 The EventStore of the node, live P2P state, logs, and RPC reads Check peers, E3 traces, protocol events, and logs of one node Hosted dashboard https://dashboard.theinterfold.com Contract events and views of one network Inspect any E3, watch CRISP polls, and set up an operator from a browser wallet Local node dashboard The interfold binary includes the local dashboard. It needs no separate installation. It is off until you set a port. Enable the dashboard Set the dashboard port Add dashboard_port to the node definition in the configuration file. For the default node, use the node key: # interfold.config.yaml node : dashboard_port : 9092 For a named node, set the key under nodes.<name> . Select a free port. The default quic_port is 9091 and the default ctrl_port is 50505. To set the port with an environment variable, use E3_NODE__DASHBOARD_PORT=9092 . For a named node, use E3_NODES__<NAME>__DASHBOARD_PORT . Restart the node Stop the node, then start it again with interfold start -v . The dashboard starts after the node finishes its startup. With -v , the log shows this line: Dashboard available at http://127.0.0.1:9092 Open the dashboard On the computer that runs the node, open http://127.0.0.1:9092 in a browser. The page title is Interfold · Node Observatory . The chip at the top right shows the node name. ⚠️ The dashboard has no authentication. Its API returns detailed protocol payloads and node diagnostics. The server binds only to 127.0.0.1 for this reason. A port forward to a public interface exposes this data to every client that can reach it. Open the dashboard from another computer The dashboard listens only on the loopback interface of the host that runs the node. To open it from your own computer, use an SSH tunnel: ssh -L 9092 :127.0.0.1:9092 user@your-server Keep the SSH session open, then open http://127.0.0.1:9092 on your own computer. In a container, 127.0.0.1 is the loopback interface of the container. A port that you publish with Docker does not reach it. Open the dashboard from the network namespace of the node process. Views The dashboard has six views. The address of each view is #<view> , for example #logs , so you can bookmark it. The views refresh automatically while the browser tab is visible. View What it shows Overview Operator address and peer ID. Network reach (connected and configured peers), registered and active nodes, E3 counts, and the number of durable events. The connected peers with remote address and direction. The on-chain operator state for each chain. The 12 newest protocol events. E3 traces Each E3 that this node saw. For the selected E3, the events of each phase: Request, Committee formation, DKG · C0, DKG · C1–C4, Key publication · C5, Encrypted computation, Decryption · C6–C7, and Output & rewards. Flow graph The events of one E3 as a graph by phase, with an arrow from each event to the events that it caused. Events Up to 2,000 recent durable events from the EventStore. You can search, and filter by source (Local, Network, EVM) and by level (Errors, Warnings, Info, Debug). Logs The operational log entries that the node keeps in memory. You can search, and filter by level. Each entry shows its fields, and the E3 ID and stage when they are present. Updates The installed version, the latest stable GitHub release and its notes, the number of active E3s, and a safe update sequence. The count is the E3s that this node is in while they run, and failed ones for one day after the failure. For failed E3s the count is an estimate: their slash reports are due until one day after the lifecycle deadline (see the report deadline ), which the dashboard does not know. The dashboard does not replace the binary. The Operator state card on the Overview reads the chain at most once every 15 s. It shows the status: Active, Registered, Not registered, or Exit queued. It also shows the available tickets, the ticket balance, the ciphernode bond, and the node counts. The ticket balance and the ciphernode bond are raw token base units. Hover over a value to see the full number. The Rewards count on the card shows the number of E3 rewards that the operator earned as a committee member. The dashboard finds the reward of the operator in the RewardsDistributed and RewardCredited events of each E3. The count includes rewards that go to a separate bond owner wallet. See Rewards . The Events view gives each event a level: Level Events Errors InterfoldError , E3Failed , CommitteeFormationFailed , ProofVerificationFailed , SignedProofFailed , ThresholdShareCollectionFailed , EncryptionKeyCollectionFailed , ComputeRequestError , CommitmentConsistencyViolation Warnings ProofFailureAccusation , AccusationVote , AccusationQuorumReached , SlashExecuted , CommitteeMemberExpelled , and unknown EVM logs Info Other events that belong to an E3 phase Debug All other events When a refresh fails, the dashboard keeps the last data and shows Live refresh paused with the error. Common tasks Trace one E3. Open E3 traces and select the E3. The current phase opens first. A trace that stops in a phase shows where the E3 stopped. Find errors. Open Events and set the level to Errors . Open an event to read its payload. Check the network after a restart. On Overview , compare the connected peers with the configured peers. A network error appears in the Connected nodes panel. Prepare an upgrade. Open Updates . Wait until the active E3 count is 0 before you stop the node. See Upgrades . JSON API The dashboard gets its data from a JSON API on the same port. You can call the API with curl on the host that runs the node: curl -s http://127.0.0.1:9092/api/snapshot | jq '.network' The API has five endpoints: /api/snapshot , /api/e3 , /api/events , /api/logs , and /api/updates . Dashboard API gives the parameters, the response fields, and the errors of each endpoint. For OpenAPI tools, use the OpenAPI description . Protocol events come from the durable EventStore of the node. Log entries come from a bounded in-memory store, and the node also writes them to ciphernode.jsonl in the node data directory. Log entries are diagnostics, not protocol records. Monitor the node with the API A monitoring system can read the API and send an alert when a value is out of range. This procedure makes a check that sends an alert when the node has fewer than 10 connected peers. The check needs curl and jq on the host of the node. Install the check script Save this script as /usr/local/bin/check-interfold-peers.sh . Set PORT to your dashboard_port , and set MIN_PEERS to your limit. #!/usr/bin/env bash # Exit 0 when the peer count is good, 1 when it is low, 2 when the check fails. PORT = 9092 MIN_PEERS = 10 body = $( curl -sf --max-time 10 "http://127.0.0.1:${PORT}/api/snapshot") || { echo "CRITICAL: dashboard API does not answer" exit 2 } peers = $( jq -e '.network.connected_peers | if type == "array" then length else error("no peer list") end' <<< "$body" 2> /dev/null ) || { echo "CRITICAL: response is not a dashboard snapshot" exit 2 } if [ "$peers" -lt "$MIN_PEERS" ]; then echo "WARNING: ${peers} connected peers (minimum ${MIN_PEERS})" exit 1 fi echo "OK: ${peers} connected peers" Make the script executable: sudo chmod 755 /usr/local/bin/check-interfold-peers.sh The exit codes follow the Nagios plugin convention: 0 is OK, 1 is a warning, and 2 is a critical failure. The script also fails when the node is stopped, and when the response is not a
프로젝트로 돌아가기