mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
TestAcceptDrainsWhatTheChainHasPassed accepted one block carrying BOTH transactions, so Publish removed the expired one as an accepted one and the pool emptied whether PruneExpired ran or not — deleting the call left it green. The pool now holds a transaction that never fits in a block, because a better-paying one keeps taking the slot, and the assertion is that the chain moving past its expiry is what frees it. Formatted the two plugin mains.
42 lines
883 B
Go
42 lines
883 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/zkvm"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/sys/ulimit"
|
|
"github.com/luxfi/vm/chain"
|
|
"github.com/luxfi/vm/rpc"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) > 1 && os.Args[1] == "version" {
|
|
fmt.Println("ZK-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)
|
|
}
|
|
|
|
f := &zkvm.Factory{}
|
|
raw, err := f.New(log.Root())
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "factory error: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
vm := raw.(chain.ChainVM)
|
|
if err := rpc.Serve(context.Background(), log.Root(), vm); err != nil {
|
|
fmt.Fprintf(os.Stderr, "rpc.Serve error: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|