Skip to content

Commit

Permalink
update retry_amendment
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabreznik committed Feb 16, 2024
1 parent 611ec4a commit 516763e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 31 deletions.
22 changes: 11 additions & 11 deletions demo/scenarios/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ module.exports = [
{ "name": "nina", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "alex", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "ana", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "miguel", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "andre", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "hans", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "mike", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "luis", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "isabel", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "olga", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "jota", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "serena", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "gus", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "martin", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "miguel", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "andre", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "hans", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "mike", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "luis", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "isabel", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "olga", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "jota", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "serena", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "gus", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "martin", "behavior": ["register_chain_account", "offer_service"] },
]
22 changes: 11 additions & 11 deletions demo/scenarios/3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ module.exports = [
{ "name": "iztok", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "rok", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "katja", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "blaz", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "lovro", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "mateja", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "ivanka", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "slavko", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "vinko", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "vesna", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "nada", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "cveta", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "matic", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "nejc", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "blaz", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "lovro", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "mateja", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "ivanka", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "slavko", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "vinko", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "vesna", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "nada", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "cveta", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "matic", "behavior": ["register_chain_account", "offer_service"] },
// { "name": "nejc", "behavior": ["register_chain_account", "offer_service"] },
]
30 changes: 23 additions & 7 deletions src/node_modules/datdot-node-javascript-internal/chain.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/roles/attester.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ async function handle_hostingSetup (args) {
for (const key of peers) {
if (!conn[key]) failedKeys.push(key.toString('hex'))
}
// we connected to all but it still timed out
if (!failedKeys.length) failedKeys.push(...hosterstringkeys, ...encoderstringkeys)
const report = { id: amendmentID, failed: failedKeys, sigs }
const nonce = await account.getNonce()
await chainAPI.amendmentReport({ report, signer, nonce })
Expand Down Expand Up @@ -575,7 +577,7 @@ async function performanceChallenge_handler (args) {
const { feedkey, contracts: contractIDs } = feedObj
const topic = datdot_crypto.get_discoverykey(feedkey)
log({ type: 'challenge', data: { text: 'Performance challenge for feed', feedObj } })
const { hosterkeys, chunks } = await get_challenge_data({ chainAPI, selectedHosters, contractIDs, log })
const { hosterkeys, hosterIDs, chunks } = await get_challenge_data({ chainAPI, selectedHosters, contractIDs, log })

var conns = {}
var attesting = []
Expand All @@ -588,7 +590,7 @@ async function performanceChallenge_handler (args) {
}

for (var i = 0; i < hosterkeys.length; i++) {
const hoster_id = selectedHosters[i]
const hoster_id = hosterIDs[i]
const hosterkey = hosterkeys[i]

const tid = setTimeout(() => {
Expand Down

0 comments on commit 516763e

Please sign in to comment.