mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
CRYPTO (Red/cryptographer HIGH): manifest state root was a hand-rolled len||k||len||v SHA-256 fold (length-extendable, no domain sep). Now SHAKE256 + SP 800-185 leftEncode framing + 'SCHAIN_STATE_ROOT_V1' domain, mirroring the validator NodeID scheme (ids/node_id_scheme.go) — not length-extendable, domain-separated, PQ-strength. Full schain suite green (determinism + change-sensitivity + Verify-rejects-tampered-root), NO sum bypass. DEPS (integrity, NOT bypassed): luxfi/[email protected] had been re-tagged (go.sum recorded an immutable-tag hash that no longer matched the served bits). Fixed PROPERLY by moving to the clean v0.8.11 and recording the real hashes; added the private hanzos3 org to GOPRIVATE (it was missing) so luxfi/zapdb's hanzos3/go-sdk dep resolves via git+go.sum, not the public sumdb. go.sum is now correct, not skipped. CI: registered schain in .github/images.json (build matrix); added the canonical schain/cmd/plugin/main.go (ZAP-native vm/rpc.Serve, no build tag — the path the release workflow builds), removing M0's grpc-tagged rpcchainvm plugin. Plugin builds clean via ./schain/cmd/plugin.
34 lines
730 B
Go
34 lines
730 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/luxfi/chains/schain"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/sys/ulimit"
|
|
"github.com/luxfi/vm/rpc"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) > 1 && os.Args[1] == "version" {
|
|
fmt.Println("S-Chain-VM/1.0.0")
|
|
os.Exit(0)
|
|
}
|
|
|
|
if err := ulimit.Set(ulimit.DefaultFDLimit, log.Root()); err != nil {
|
|
fmt.Fprintf(os.Stderr, "failed to set fd limit: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
vm := schain.NewChainVM(log.Root())
|
|
if err := rpc.Serve(context.Background(), log.Root(), vm); err != nil {
|
|
fmt.Fprintf(os.Stderr, "rpc.Serve error: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|