Dated correction (2026-10-27): notarizare/verifica-certificat.mjs names the certificate slot as element 5 of extraData, counting from 0 as aere-node SPEC.md 2.3 does; its messages and comment said element 6.
This commit is contained in:
parent
79c57a16ac
commit
eb88b300a7
@ -111,7 +111,8 @@ const areTextASCII = (u8, s) => {
|
|||||||
// (measured 2026-09-11 on chain 2800, at the admission of the tenth validator), so "32 bytes, no 'besu'" alone called every one of
|
// (measured 2026-09-11 on chain 2800, at the admission of the tenth validator), so "32 bytes, no 'besu'" alone called every one of
|
||||||
// its blocks an anchor. The anchor digest is a keccak256 output; zero is refused here as it is in every gate of the house.
|
// its blocks an anchor. The anchor digest is a keccak256 output; zero is refused here as it is in every gate of the house.
|
||||||
const esteZero = (u8) => Array.from(u8).every((b) => b === 0);
|
const esteZero = (u8) => Array.from(u8).every((b) => b === 0);
|
||||||
// Minimal RLP reader (lists and strings), enough to name the FORM of the certificate in element 6 of extraData.
|
// Minimal RLP reader (lists and strings), enough to name the FORM of the certificate in element 5 of extraData
|
||||||
|
// (counting from 0, as aere-node SPEC.md 2.3; corrected 2026-10-27: this said element 6).
|
||||||
function citesteRLP(u8, pos) {
|
function citesteRLP(u8, pos) {
|
||||||
const p = u8[pos];
|
const p = u8[pos];
|
||||||
if (p < 0x80) return { list: false, bytes: u8.slice(pos, pos + 1), next: pos + 1 };
|
if (p < 0x80) return { list: false, bytes: u8.slice(pos, pos + 1), next: pos + 1 };
|
||||||
@ -134,8 +135,8 @@ export function formaCertificatului(extra) {
|
|||||||
if (!top.list) return { forma: 'unreadable', text: 'extraData is not an RLP list' };
|
if (!top.list) return { forma: 'unreadable', text: 'extraData is not an RLP list' };
|
||||||
if (top.items.length < 6) return { forma: 'none', text: 'no certificate element (extraData has ' + top.items.length + ' elements)' };
|
if (top.items.length < 6) return { forma: 'none', text: 'no certificate element (extraData has ' + top.items.length + ' elements)' };
|
||||||
const el = top.items[5];
|
const el = top.items[5];
|
||||||
if (!el.list) return { forma: 'unknown', text: 'element 6 is not a list' };
|
if (!el.list) return { forma: 'unknown', text: 'element 5 of extraData (counting from 0, the certificate slot) is not a list' };
|
||||||
if (el.items.length === 0) return { forma: 'none', text: 'element 6 is the empty list (no certificate)' };
|
if (el.items.length === 0) return { forma: 'none', text: 'element 5 of extraData (counting from 0, the certificate slot) is the empty list (no certificate)' };
|
||||||
const first = el.items[0];
|
const first = el.items[0];
|
||||||
if (first.list) return { forma: 'v1', text: 'certificate v1, ' + el.items.length + ' Falcon-512 rows (no scheme tags, no round)' };
|
if (first.list) return { forma: 'v1', text: 'certificate v1, ' + el.items.length + ' Falcon-512 rows (no scheme tags, no round)' };
|
||||||
const scalar = (it) => (it.list ? null : Array.from(it.bytes).reduce((a, b) => a * 256 + b, 0));
|
const scalar = (it) => (it.list ? null : Array.from(it.bytes).reduce((a, b) => a * 256 + b, 0));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user