The Interfold 백서

The Interfold

원문

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

snapshot, for example HTML or a JSON object without a peer list. Test the script Run /usr/local/bin/check-interfold-peers.sh on the host of the node. The script shows the peer count, for example OK: 21 connected peers . Connect the script to your monitoring system Use a monitoring agent that runs a command and reads its exit code. Without such an agent, use a cron entry that runs your alert command when the check fails: */5 * * * * /usr/local/bin/check-interfold-peers.sh || /usr/local/bin/send-alert "interfold peers" /usr/local/bin/send-alert is an example. Replace it with the command that sends your alert. Poll /api/snapshot at an interval of 30 s or more. Each request reads the new EventStore events and can start chain RPC reads. You can make checks for other values with the same method: Condition Endpoint jq expression or field Few connected peers /api/snapshot .network.connected_peers | length Few peers on the gossip topic /api/snapshot .network.gossip_subscribed_peers Network error /api/snapshot .network.last_error is present Operator not active on a chain /api/snapshot .operator.chains[] | select(.operator_active | not) | .chain_name Chain RPC read failed /api/snapshot .operator.error is present More failed or degraded E3s /api/snapshot .protocol.e3_failed and .protocol.e3_degraded increase between two polls New error log entries /api/logs ?level=error&since=<next_cursor of the previous poll> returns entries New release /api/updates .update_available is true Hosted dashboard The hosted dashboard at https://dashboard.theinterfold.com reads contract events and views directly from the chain. It does not connect to your ciphernode, so it cannot show peers, logs, or the local state of your node. Each page reads one network, and the page shows the network name. The VITE_NETWORK_HOSTS build variable maps each domain to a network ( sepolia or mainnet ). Other hosts use the VITE_NETWORK build variable, default sepolia . It has three views: View Link What it shows E3 inspector #inspector Each E3 on the network: request, committee, key generation, input window, compute, decryption, publication, failure, fees, and the event log. CRISP #crisp The CRISP polls of the network and their stages. The view only shows data. Run a ciphernode #operator (opens in a new tab) An interactive operator guide that sends transactions from a browser wallet. The operator guide is the only view that writes to the chain. It reads the bond size, the ticket price, the minimum ticket count, and the exit delay from BondingRegistry . It has five steps: Connect a wallet. Authorize the bond owner. The operator key sends setBondOwner . Bond the ciphernode bond. The bond owner approves FOLD and sends bondCiphernodeFor . Register the ciphernode. The bond owner sends registerOperatorFor . Buy tickets. The bond owner approves the ticket collateral and sends addTicketBalanceFor . The guide simulates each transaction before the wallet prompt, so a contract error, for example NotBondOwner , shows before you sign. The guide sets up the on-chain position only. The ciphernode must run with the same operator key. See Registration for the CLI procedure. Next steps Troubleshooting Symptoms, log lines, and checks for a node that does not behave as expected. Fix Dashboard API Endpoints, parameters, and response fields of the JSON API. Reference Upgrades Install a new release, and reset state when a release needs it. Maintain Configuration reference Every node configuration key, including the dashboard port. Reference Manage Tickets Upgrades ## /operate/upgrades Run a Ciphernode Upgrades Upgrades This page explains how the Interfold versions ciphernode releases and how to install a new release. It also explains how the on-chain release gate decides which nodes can serve on committees. It is for operators who run a ciphernode. At the end, you can tell which kind of release you have and install it. You can also reset the node state when a release changes the storage format. Release versions Each release has three values. Only the two compatibility values decide eligibility. Value Where it is defined Increases when Release version The workspace version, for example 0.18.0 Every release. interfold --version prints it. protocol_version crates/config/protocol-release.toml Contracts, events, cryptography, or protocol behavior become incompatible. node_generation crates/config/protocol-release.toml Every operator must install a node-only fix. The release ID is keccak256("interfold.node.release:v1:" + version) . The node records it on-chain, but the ID does not decide eligibility. Recent releases Release protocol_version node_generation Storage schema Gossip and sync wire versions v0.15.1, v0.15.2 4 1 6 4 and 3 v0.16.0 4 1 6 4 and 3 v0.17.0 4 2 6 4 and 3 v0.18.0 4 2 7 4 and 3 Nodes on releases v0.15.1 through v0.18.0 share protocol_version 4 and the same P2P wire versions, so they can connect to each other. A node on generation 1 can connect, but it cannot be active when the chain requires generation 2. The storage schema changes at v0.18.0, so a node that ran v0.15.1 through v0.17.0 must reset its state before v0.18.0 can start. The v0.19 DKG message format requires storage schema 8 and gossip/sync wire versions 5 and 4. It uses protocol version 8 and node generation 2. Complete active E3 work before the storage reset . The signed DKG messages cannot reuse schema 7 state. The on-chain release gate The Interfold contract points to a node release registry ( INodeReleaseRegistry ). The registry stores the required values in requiredProtocolVersion() and requiredNodeGeneration() . An operator is release-ready ( isNodeReleaseReady ) when both of these conditions are true: The acknowledged protocol_version is equal to the required value. The acknowledged node_generation is equal to or larger than the required value. A release with a higher protocol_version than the required value is also not ready. The BondingRegistry active check includes release readiness, so a node that is not release-ready cannot enter new committees. See When a ciphernode is active . Startup check Before the node starts its protocol actors, it checks each enabled chain: It reads nodeReleaseRegistry() , bondingRegistry() , and ciphernodeRegistry() from the Interfold contract. The configured addresses must match. It compares its own compatibility values with the required values. If the operator already acknowledged this release, and the operator is active or not registered, the node logs Ciphernode release is accepted . Otherwise, the node logs Acknowledging ciphernode release and sends acknowledgeNodeRelease(releaseId, protocolVersion, nodeGeneration) from the operator key. The registry emits OperatorNodeReleaseAcknowledged and refreshes the operator status. The acknowledgment is a transaction, so the operator wallet needs ETH for gas. These errors stop the startup: Error Meaning ciphernode protocol version <x> does not match required version <y> The binary is for a different protocol version. ciphernode generation <x> is below required generation <y> Governance requires a newer node-only release. Interfold has no node release controller; keep this ciphernode stopped until the protocol upgrade is complete The contracts do not have a release registry yet. configured contracts do not match Interfold dependencies: … The bonding_registry or ciphernode_registry address in the configuration is wrong. The release acknowledgment is a statement by the operator. It prevents the accidental use of old software. It does not prove which executable runs. Threshold cryptography, proof verification, and slashing still protect the protocol against a malicious operator. Check the required values Read the values with cast . Get the Interfold address from Contracts and addresses : cast call < Interfol d > "nodeReleaseRegistry()(address)" --rpc-url < RPC_UR L > cast call < NodeReleaseRegistr y > "requiredProtocolVersion()(uint32)" --rpc-url < RPC_UR L > cast call < NodeReleaseRegistr y > "requiredNodeGeneration()(uint32)" --rpc-url < RPC_UR L > cast call < NodeReleaseRegistr y > "operatorNodeRelease(address)((bytes32,uint32,uint32))" \ 0 xOPERATOR --rpc-url < RPC_UR L > P2P compatibility Every P2P protocol name includes the network ID and the protocol_version . The Kademlia, sync, gossip, and Identify names all use the prefix interfold/<network_id>/protocol/<protocol_version> . Nodes with different protocol versions therefore do not connect to each other. The node_generation is not part of these names. A node-only cutover removes old nodes from new committees, but old and new nodes stay on one P2P network. A bug that changes message parsing, message meaning, or peer safety therefore needs a new protocol_version . Release types Release type Values that change Governance action Old nodes Compatible release None None Stay eligible. Operators upgrade when they want. Mandatory node release node_generation Raise the required generation Become inactive. They cannot enter new committees. Protocol release protocol_version Upgrade the contracts and raise the required version in one proposal Become inactive and lose the P2P connection to new nodes. Compatible release A compatible release keeps both values. Old and new nodes stay eligible, so you can install the release when you want. If you run several nodes, restart one node at a time. Keep enough committee members online so that each active committee keeps its threshold. A release that changes the sortition seed or the ticket score that nodes compute is an exception. While old and new nodes run together, they select different nodes to submit tickets. Fewer nodes than the committee size can then submit, and the E3 fails with InsufficientCommitteeMembers . No honest node is slashed for this. For such a release, governance pauses new E3 requests until the operators have upgraded, then resumes them. Mandatory release Governance uses a cutover for a mandatory node release or a protocol release: Pause Governance pauses new E3 requests. Drain Active E3s and committees reach a terminal state. Raise Governance raises the required version or generation. Restart Operators start the new release. Each node acknowledges it. Resume Governance resumes requests when enough nodes are active. setRequiredNodeRelease reverts with NodeReleasePolicyRequiresPause while requests are open. It reverts with NodeReleasePolicyInUse while an E3 is active or a committee is not released. A new requirement makes every operator inactive at once. Each upgraded node acknowledges its release at startup and becomes active again. Before governance resumes requests, it refreshes every registered operator and checks that committeeOwnerCapacity covers the largest committee. For a protocol release, operators upgrade at least one configured bootstrap peer first, so that new nodes can find each other. The required values never decrease. setRequiredNodeRelease reverts with NodeReleasePolicyRegression for a lower value. A rollback is a new release with a higher node_generation or protocol_version that contains the earlier code. Upgrade a ciphernode Use this procedure for every release. The release notes tell you if a release changes the storage schema or the configuration. Read the release notes Open the release on GitHub, or open the Updates view of the local dashboard . Find out if the release needs a state reset or a configuration change. Wait for active work to finish Make sure that the node has no active E3. The Updates view shows the number of active E3s. A stop during a DKG can make that E3 fail. Stop the node Send SIGTERM to the process, or press Ctrl+C in its terminal. Wait for the Graceful shutdown barrier complete log line, or for the process to exit. Back up the node Copy the stopped configuration and data directories to a safe location. Migrate a node lists the files. Install the release Install the exact release that the release notes name: Install method Command interfoldup interfoldup update --version v0.18.0 , or interfoldup update for the latest Docker docker pull ghcr.io/theinterfold/ciphernode:0.18.0 DAppNode Update the Interfold ciphernode package in the DAppNode interface Check the version Run interfold --version . The output must be the release that you installed, for example interfold 0.18.0 . Reset the state if the release needs it If the release changes the storage schema, follow Reset node state now. Validate the state Run interfold node validate --name <node> with the new binary. The report must end with VALIDATION PASSED . The command takes the process lock of the node, so it fails while a node runs. Start the node Start the node the same way as before, for example interfold start -v --name <node> . Look for Ciphernode release is accepted or Acknowledging ciphernode release in the log. Verify the node Run interfold ciphernode status . Make sure that Active is true . On the dashboard, make sure that the node has connected peers. If the startup fails with a release error, leave the node stopped. Install the release that the chain requires, or wait for the protocol upgrade to complete. For Docker, run the interfold commands of this procedure in a one-off container from the new image, through the image entrypoint. Mount the same volumes, as in Validate the state . Do not use --entrypoint interfold . Upgrade a node that serves an active E3 Use this procedure when the new release keeps the storage schema of the running release. The node keeps its state, so it keeps its key share for each active E3. v0.19.0 raises the schema, so this procedure does not apply to an upgrade to v0.19.0. Upgrade a node to v0.19.0 only when it serves no active E3. Then reset its state as Reset node state describes. Stop the node gracefully, and wait until the process exits. Do not send SIGKILL . For Docker, run docker stop --time 65 <container> . Back up the complete data directory and the complete configuration directory. interfold config get db_file shows a path in the data directory. interfold config get key_file shows a path in the configuration directory. For Docker, back up the complete volume. A container from an image earlier than v0.19.0 keeps its state inside the container, not on the volume. For such a container, see Move state from an earlier image . Run interfold node validate with the new binary. The report must show on-disk schema version <n> matches this binary , where <n> is the schema of the running release. It must end with VALIDATION PASSED — state is intact and consistent. If one of these lines is missing, do not start the new binary. The line empty store will be initialized means that the command found no state at this location. Start the new binary. Make sure that the log shows Ciphernode release is accepted . To roll back, stop the node, restore both directories from the backup, and start the previous binary. Never run interfold node reset-data or interfold nodes purge on a member of a committee with an active E3. Both commands delete its key shares, and the chain cannot restore them. v0.17.0 uses storage schema 6, v0.18.0 uses schema 7, and v0.19.0 uses schema 8. A binary halts on state of another schema, so every node resets its state when it upgrades to v0.19.0. Keep each node on its current release until its E3s are complete or failed, and their report deadlines are past. If the command refuses shows the checks. Reset node state The storage schema is a marker in the key/value store of the node. The binary loads existing state only when the marker is equal to its own schema version. It refuses older state and newer state, because the stored event log and actor snapshots contain protocol data in a binary format. These messages stop the startup: Message starts with Cause On-disk schema version <v> is older than this binary's … The release raised the schema. Reset the state. On-disk schema version <v> is newer than this binary's … A newer release wrote the state. Run that release or a newer one. On-disk state has no schema marker … The event log exists without the key/value store. The operator key and the libp2p keypair live in the same key/value store as the protocol state. A manual delete of the data directory therefore also deletes the identity that holds the bond. interfold node reset-data removes the state and keeps the identity. See the CLI reference . ⚠️ A reset deletes the local key share of every E3 on this node. If the node is on a committee with an active E3, that E3 loses the share of this node. A reset is not a general repair tool. reset-data refuses when the node holds key-share state for an E3 that it has not seen complete. It also refuses for an E3 that shows Failed , because the node records its own local failures that way while the E3 can continue on chain. The refusal lists each E3 and its stage, and the command deletes nothing. It also refuses while the node holds slash reports that it has not submitted, also for an E3 that is complete, because the chain cannot restore their evidence. That refusal lists each chain and the number of its reports. --allow-active-e3s overrides both refusals. A container from a CLI image earlier than v0.19.0 keeps its state inside the container, not on the volume. For such a container, follow Move state from an earlier image . It copies the state to the volume, and then it resets the state. The DAppNode package stores its state on the /data volume. Keep that volume. Use the one-off container commands below instead of the CLI image migration procedure. Confirm that a reset is necessary Read the release notes. Reset the state only when the release notes require it. Wait for active work to finish Make sure that the node has no active E3. The Updates view of the local dashboard shows the number. Without the dashboard, activeE3Count() on the Interfold contract returns the number of active E3s on the network. Stop the node Stop the process with the tool that supervises it. reset-data takes the same process lock as interfold start and refuses to run while the node runs. A Docker container of an image earlier than v0.19.0 that starts through the image entrypoint cannot start again after a stop. That entrypoint sets the password again at each start, and interfold password set refuses a key file that exists. Check the entrypoint with docker inspect -f '{{json .Config.Entrypoint}}' <container> . If it is ["ciphernode-entrypoint.sh"] , contact the protocol team before you stop the container. Record the identity Run interfold wallet get --name <node> and interfold net get-peer-id --name <node> . Write down the operator address and the peer ID. Reset the state ⚠️ Use the binary or image of the new release. reset-data in v0.18.0 and earlier has no key-share check. It deletes the key shares at once. Run the reset command: interfold node reset-data --name < nod e > --yes For DAppNode, stop the package and back up its complete /data volume first. Use the new DAppNode image, not the CLI image. Confirm its binary version: docker run --rm --entrypoint interfold < new-dappnode-imag e > --version Record the operator address and peer ID before the reset: docker run --rm --volumes-from < stopped-dappnode-containe r > --workdir /data \ --entrypoint interfold < new-dappnode-imag e > wallet get --config /data/config.yaml docker run --rm --volumes-from < stopped-dappnode-containe r > --workdir /data \ --entrypoint interfold < new-dappnode-imag e > net get-peer-id --config /data/config.yaml Run the reset against the stopped package's existing mounts: docker run --rm --volumes-from < stopped-dappnode-containe r > --workdir /data \ --entrypoint interfold < new-
프로젝트로 돌아가기