consume crypto/keccak256 (was crypto/keccak) — bump crypto v1.19.14

This commit is contained in:
Hanzo AI
2026-05-23 16:21:45 -07:00
parent 8ef8e731d4
commit f6ba5aef36
4 changed files with 55 additions and 17 deletions
+43 -2
View File
@@ -21,6 +21,47 @@ silent classification change.
| `fe4781c` | v1.9.5 | `LUX_DISABLE_CCHAIN=1` omits C-Chain from primary genesis |
| `2b16f45` | v1.9.5 | Operator-overridable C-Chain genesis via `LUX_CCHAIN_GENESIS_FILE` |
### Zoo testnet/devnet 39-char alloc address bug (May 2026)
`configs/zoo-{testnet,devnet}/genesis.json` shipped six alloc addresses with
only 39 hex chars instead of 40 — the leading `0` nibble was stripped at
genesis-generation time (commit `2b46a8b`, "regenerate all network configs").
The six bad addresses on both files were:
| Truncated (39ch, shipped) | Correct (40ch, present in C-chain alloc) |
|---|---|
| `2aCB0ee16fd2B1bF465F85D7Ee112fA80C055FC` | `02aCB0ee16fd2B1bF465F85D7Ee112fA80C055FC` |
| `3B8Bd0A20b05AADC9E457A4c967f45eEeC163c4` | `03B8Bd0A20b05AADC9E457A4c967f45eEeC163c4` |
| `54D2e1dA5A1B5b9Da158acbA42Aed1d45F5CF02` | `054D2e1dA5A1B5b9Da158acbA42Aed1d45F5CF02` |
| `5CAE5842A08165d4d736dA9E49438574283aaE9` | `05CAE5842A08165d4d736dA9E49438574283aaE9` |
| `698495959f5570420BAA955dae5eA2864933ACf` | `0698495959f5570420BAA955dae5eA2864933ACf` |
| `7283AA2c30523E9190A17b9598ff65599BAAe17` | `07283AA2c30523E9190A17b9598ff65599BAAe17` |
Symptom: subnet-evm refused to bootstrap the chain — `parsing genesis:
hex string of odd length`. The original CreateChainTx (`ZAKw...` on
testnet, `2nLY...` on devnet) carries the broken genesis bytes
immutably, so we had to re-issue under a new chain name and rewrite the
gateway. The 39→40-char fix applied in genesis is now the SAME content
subnet-evm expects.
Operators bootstrapping a fresh zoo subnet should pin the post-fix
checksums in this file (see `### Verify Checksum`). Mainnet zoo
(`zoo-mainnet/genesis.json`) was *not* affected — it has only the
treasury account plus the `0x0200…0005` precompile.
### Subnet bootstrap: chain-name collision (P-chain)
`platform.IsChainNameTaken` is case-insensitive and global across all
subnets. A failed CreateChainTx (e.g. the broken zoo above) still
permanently squats its `BlockchainName` on the P-chain ledger — you
cannot reuse the name even after fixing the genesis. Work-around used
on zoo testnet/devnet: issue under a throwaway name (`ZOOTEST123` /
`ZOODEVTEST123`), then rewrite the krakend gateway endpoint so
`/ext/bc/zoo/rpc``/ext/bc/<new-bcID>/rpc`. The route
`/ext/bc/<name>/rpc` is registered by `luxfi/node/chains/manager.go`
*only* on successful VM init — broken chains never claim the route, so
gateway-side rewrite is sufficient.
### Active versions
- Repo: `v1.9.6` (next: `v1.9.7`).
- Pinned by: `luxfi/node v1.26.10`.
@@ -464,8 +505,8 @@ These checksums are the canonical reference - if they don't match, the file has
| `mainnet/cchain.json` | `968e9f3cd19a9b88ca157db3894622272ded02f0f184b5386493ff55897001be` |
| `testnet/cchain.json` | `ba211e1bbbd7807c2224d240628facb2dfb6c2d6cde2e274eb881a57609ed038` |
| `zoo-mainnet/genesis.json` | `14c01e8bb5ac13144a3730c695847d53506647efbaada3f3240a16e7b10684f7` |
| `zoo-testnet/genesis.json` | `74357b85e6968ca70d8907b2e940e5e234fd6b288749865d91ab69a6083e6dae` |
| `zoo-devnet/genesis.json` | `dd604fee5c78f7367b314a9a7d7ee1d5f8c42839165164262368afc7dd91fc5e` |
| `zoo-testnet/genesis.json` | `b8eea8c6b3276ebadce7e8ef9296bc14b56990ae04cd200a4663f5af21193534` |
| `zoo-devnet/genesis.json` | `4890a40fe7891722c90efb728f11b14aeef9795c2b897eb0140e1e0ae3b6254c` |
| `spc-mainnet/genesis.json` | `9c01115559556fc245d4993b193889370bd99edd22a7fa1e9e3d7ddafbb63535` |
| `spc-testnet/genesis.json` | `af12bb81dd9abce26b7a311f00fa2ac7f5adfb996e698b9f473252199f747b2c` |
| `spc-devnet/genesis.json` | `317d54ac7846b0f174964552b4949d858072f6ffbc37f6c10092e01d595ce46f` |
+3 -4
View File
@@ -5,7 +5,7 @@ go 1.26.3
require (
github.com/luxfi/constants v1.4.7
github.com/luxfi/container v0.0.4
github.com/luxfi/crypto v1.19.0
github.com/luxfi/crypto v1.19.14
github.com/luxfi/go-bip32 v1.0.2
github.com/luxfi/go-bip39 v1.1.2
github.com/luxfi/ids v1.2.9
@@ -22,7 +22,7 @@ require (
require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/luxfi/accel v1.0.7 // indirect
github.com/luxfi/accel v1.1.4 // indirect
github.com/luxfi/atomic v1.0.0 // indirect
github.com/luxfi/compress v0.0.5 // indirect
github.com/luxfi/concurrent v0.0.3 // indirect
@@ -41,7 +41,6 @@ require (
)
require (
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260311194731-d5b7577c683d // indirect
github.com/btcsuite/btcd/btcutil v1.1.6 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -53,7 +52,7 @@ require (
github.com/luxfi/codec v1.1.4 // indirect
github.com/luxfi/consensus v1.23.25
github.com/luxfi/formatting v1.0.1
github.com/luxfi/geth v1.16.79 // indirect
github.com/luxfi/geth v1.16.98 // indirect
github.com/luxfi/math/big v0.1.0 // indirect
github.com/luxfi/metric v1.5.1 // indirect
github.com/luxfi/mock v0.1.1 // indirect
+6 -8
View File
@@ -1,7 +1,5 @@
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260311194731-d5b7577c683d h1:EA+kZ8mxGb1W/ewiIBMzb/1gg5BiW1Fvr3r4qCUBJEg=
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260311194731-d5b7577c683d/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
@@ -83,8 +81,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/luxfi/accel v1.0.7 h1:ksHieAp50umwqxqgyHk9WiOmXM54kia3IEDb5H7FsM8=
github.com/luxfi/accel v1.0.7/go.mod h1:iZD3oxffiMEIT/KvzD8bgwC/cBn4AYlMW3QJpbRa4RE=
github.com/luxfi/accel v1.1.4 h1:UOvS/00vG6WByf2P1tGYRkoBcsUkFuCgw7o2xU03OoE=
github.com/luxfi/accel v1.1.4/go.mod h1:K00BcnLzEYMPHwCFq8Tf/450ApmTs9xBVvYOnofJCkc=
github.com/luxfi/address v1.0.1 h1:Sc4keyuVzBIvHr7uVeYZf2/WY9YDGUgDi/iiWenj49g=
github.com/luxfi/address v1.0.1/go.mod h1:5j3Eh66v9zvv1GbNdZwt+23krV8JlSDaRzmWZU8ZRM0=
github.com/luxfi/atomic v1.0.0 h1:xUV60MuzRvXngaQ1sM0yVC2v4TRoLlUGkkH7M9PS4yw=
@@ -103,14 +101,14 @@ github.com/luxfi/constants v1.4.7 h1:e/Qs+DQP3pugle3Zncq6fZCxKgqqtbyD/z7Gm4ZjsYg
github.com/luxfi/constants v1.4.7/go.mod h1:hOszZ2NDQ8gMZKncfcZ67PXkb5OIbnwAzXC3oFbQwW0=
github.com/luxfi/container v0.0.4 h1:BXhF82WyfqVP5mjlNcr7tP0Fcnvl0Ap1rkiu+rq5XuM=
github.com/luxfi/container v0.0.4/go.mod h1:Z3SpmMF5d4t77MM0nHYXURpn+EMVaeu1fhbd/3BGaek=
github.com/luxfi/crypto v1.19.0 h1:VtH6kvZrCEjCnkHPkhExDU+GJ0ZulYX4rnA+lXJdJHw=
github.com/luxfi/crypto v1.19.0/go.mod h1:ee525i8Recbpb0jVTDZYZBr1MmvJ27OITJHZ/nlNMBw=
github.com/luxfi/crypto v1.19.14 h1:2/3jq1F61bDkr8ifA8hPSCB8tmHkum7B6SXoBb6xZ8E=
github.com/luxfi/crypto v1.19.14/go.mod h1:INjdZtke85k8hX/QAmTMAY8bbZ4gzGZQLqURg3xf6Gk=
github.com/luxfi/database v1.18.3 h1:gg+xwhKUxXa7fDoOD8IS91E71QqoEtcDCl2nfS61Jgg=
github.com/luxfi/database v1.18.3/go.mod h1:sv0pYCGKlK1aNJTICxFUDpVWCJTigoLlshHmV/1pg7c=
github.com/luxfi/formatting v1.0.1 h1:ZnE1rAdEUds9yAegdVdGDOBGN6hLMPOv6E03Fp8IEYo=
github.com/luxfi/formatting v1.0.1/go.mod h1:mYzNf5DJOiqSSKUPzNj5dKy4tstFbN3pZlkI5716eKc=
github.com/luxfi/geth v1.16.79 h1:MtP8ZUuSVZDjmZDa1kTJCl0PpG8+wGbQft652GO6a3A=
github.com/luxfi/geth v1.16.79/go.mod h1:6xNi4sHoh0v1kBf0TOjmFhBg5+4umbSqrwiFZsDanZ0=
github.com/luxfi/geth v1.16.98 h1:w187TtKuGStf3tm2bshuHVKBv2Frjx0lT54kQVXyNHA=
github.com/luxfi/geth v1.16.98/go.mod h1:6kEzSExdk9CPQDPXALt6P3HfQqBq7KF1Jrrv9gBpxbU=
github.com/luxfi/go-bip32 v1.0.2 h1:7vFbb+Wr4Z499q2tuCLdd7wWjtn8sH+HWBlx76mhH9Y=
github.com/luxfi/go-bip32 v1.0.2/go.mod h1:bc7/LXDKAJQZ/F0Xjf5yXaTZxY9/ssLb4FC+Hxn/cDk=
github.com/luxfi/go-bip39 v1.1.2 h1:p+wLMPGs6MLQh7q0YIsmy2EhHL7LHiELEGTJko6t/Jg=
+3 -3
View File
@@ -22,7 +22,7 @@ import (
// stop-gap.
"github.com/luxfi/crypto"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/keccak"
"github.com/luxfi/crypto/keccak256"
"github.com/luxfi/crypto/pq/mldsa/mldsa65"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/go-bip32"
@@ -602,14 +602,14 @@ func keccakAddr(pubX, pubY *big.Int) (out [20]byte) {
buf := make([]byte, 64)
pubX.FillBytes(buf[:32])
pubY.FillBytes(buf[32:])
h := keccak.Sum256(buf)
h := keccak256.Sum(buf)
copy(out[:], h[12:])
return
}
// keccak256 computes the Keccak-256 hash via the canonical luxfi/crypto/keccak.
func keccak256(data []byte) []byte {
h := keccak.Sum256(data)
h := keccak256.Sum(data)
return h[:]
}