fast-time: the bridge check takes the smaller of a key's two reward entries as the merged parent's (the segment lists the parent before the chain block)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
69588aa155
commit
446f2d38e1
1 changed files with 6 additions and 6 deletions
|
|
@ -234,12 +234,12 @@ try {
|
|||
const blk = await evmCall(a.evmPort, 'eth_getBlockByHash', [`0x${row.chain_block}`, false]);
|
||||
const addr = bridge.address[row.parent_key];
|
||||
if (!blk || !addr) continue;
|
||||
// the paid block's entry: the last reward entry for its miner's address (a chain block that merges its own key's
|
||||
// block carries two entries for that address, and both are the same amount within one segment, since the
|
||||
// execution layer credits every block of a segment at the chain block's DAA until ledger N8's rule is on)
|
||||
const entries = (blk.igneum?.rewards || []).filter(e => String(e.miner).toLowerCase() === addr);
|
||||
const entry = entries.length ? entries[entries.length - 1] : null;
|
||||
if (!entry) continue;
|
||||
// the paid block's entry: of the reward entries for its miner's address (a chain block that merges its own key's
|
||||
// block carries two, its own and the parent's, in the segment's order), the parent's is the smaller credit under
|
||||
// ledger N8's rule (the older block on the launch ramp) and either one before it (both at the chain block's DAA)
|
||||
const entries = (blk.igneum?.rewards || []).filter(e => String(e.miner).toLowerCase() === addr).map(e => BigInt(e.wei));
|
||||
if (!entries.length) continue;
|
||||
const entry = { wei: entries.reduce((m, w) => (w < m ? w : m)).toString() };
|
||||
bridge.rows++;
|
||||
const wei = BigInt(entry.wei), want = BigInt(row.producer) * WEI_PER_SOMPI;
|
||||
// the EVM credit per key, for the bonus reading on the EVM side (ramp-neutral: a ratio of medians)
|
||||
|
|
|
|||
Loading…
Reference in a new issue