Keep route-server networks on the route server (#265)
With an Open policy and the route server on, the peering desk still picked networks the route server already reached and stored them as bilateral sessions. It now skips a request from a network ixSessions() already has, after drawing its random numbers, so the desk's draws stay as they were. The changed peer list still moves seeded games a little: the Mid-Atlantic scenario's floor goes from day 40 to 30 (main wins on days 34-58 across seeds), and the past week 2026-W44 is regenerated as rev 3.
This commit is contained in:
parent
da1a4e2f3c
commit
3e57b41e13
5 changed files with 29 additions and 2 deletions
23
tests/route-server-peers.test.js
Normal file
23
tests/route-server-peers.test.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
// #265: with the route server on and an Open policy, the peering desk must not turn
|
||||
// networks you already reach through the route server into bilateral sessions.
|
||||
test('#265 peering desk leaves route-server networks on the route server', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;S.nextFail=S.nextEvent=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'ams'});S.pops.ams.rgen=3;ACT.buyIx({city:'ams',tier:1});ACT.rs({city:'ams'});compute()");
|
||||
assert.equal(ev('ppol()'), 'open');
|
||||
const viaRs = JSON.parse(ev("JSON.stringify(ixMembers('ams').filter(id=>NET[id].pol==='open'&&ixSessions('ams').has(id)&&!S.peers[id+'@ams']))"));
|
||||
assert.ok(viaRs.length > 0, 'some networks are reached through the route server');
|
||||
// Every day: someone asks, at this IX, a real network, each candidate in turn, fresh PeeringDB.
|
||||
for (let i = 0; i < 60; i++) {
|
||||
ev(`(()=>{const q=[0.01,0.01,0.01,${i / 60},0.9];Math.random=()=>q.length?q.shift():0.5;})()`);
|
||||
ev(`peeringDeskDay(S.day+${i})`);
|
||||
}
|
||||
const made = JSON.parse(ev(`JSON.stringify(${JSON.stringify(viaRs)}.filter(id=>S.peers[id+'@ams']))`));
|
||||
assert.deepEqual(made, [], 'route-server networks stay "via RS"');
|
||||
const bilateral = JSON.parse(ev("JSON.stringify(Object.keys(S.peers).filter(k=>k.endsWith('@ams')))"));
|
||||
assert.ok(bilateral.length > 0, 'networks the route server does not reach still get their own sessions');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
@ -41,8 +41,9 @@ const PLAY = {
|
|||
// The 1.6T chains: grow the traffic first, then light every hop at once (a day-0 build also gets there, just).
|
||||
pac: { ref: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], HIRE, ['served', 145], ['link', 'lax', 'hnl', 4, 'seaus'], ['link', 'hnl', 'suv', 4, 'scx'], ['link', 'suv', 'syd', 4, 'scx']],
|
||||
win: [50, 120], cheese: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], ['link', 'lax', 'syd', 3, 'hwk'], ['loans']], by: null },
|
||||
// The win day swings with the seed (34 to 58 over five seeds in 2.5.0), so the floor sits below that spread.
|
||||
atl: { ref: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), HIRE, ['link', 'mia', 'bda', 4, 'sol'], ['link', 'bda', 'pdl', 4, 'sol'], ['link', 'pdl', 'mad', 4, 'sol'], ['served', 90], ['link', 'lis', 'tci', 4, 'ace'], ['link', 'tci', 'lag', 4, 'twoaf'], ['bb', 'lag']],
|
||||
win: [40, 120], cheese: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), ['link', 'mia', 'mad', 3, 'col3'], ['link', 'lis', 'lag', 3, 'equi'], ['loans']], by: null },
|
||||
win: [30, 120], cheese: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), ['link', 'mia', 'mad', 3, 'col3'], ['link', 'lis', 'lag', 3, 'equi'], ['loans']], by: null },
|
||||
};
|
||||
|
||||
test('C1 played: every scenario has a reference strategy and a shortcut that fails', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue