Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions consensus/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ def process_op(op):
raise Exception('Error from apply service')


def save_snapshot(block):
dir_name = config.SNAPSHOTS_PATH.format(block)
fnl_dir_name = f'{dir_name}_fnl'
dir_path = os.path.dirname(os.path.realpath(__file__))
collections_file = os.path.join(dir_path, 'collections.json')
res = os.system(
f'arangodump --overwrite true --compress-output false --server.password "" --server.endpoint "tcp://{config.BN_ARANGO_HOST}:{config.BN_ARANGO_PORT}" --output-directory {dir_name} --maskings {collections_file}')
assert res == 0, "dumping snapshot failed"
shutil.move(dir_name, fnl_dir_name)


def update_num_sealers():
Expand Down Expand Up @@ -134,7 +125,6 @@ def main():
if tx['to'] and tx['to'].lower() in (config.TO_ADDRESS.lower(), config.DEPRECATED_TO_ADDRESS.lower()):
process(tx['input'], block.timestamp)
if block_number % config.SNAPSHOTS_PERIOD == 0:
save_snapshot(block_number)
# PREV_SNAPSHOT_TIME is used by some verification
# algorithms to filter connections that are made
# after previous processed snapshot
Expand Down
9 changes: 4 additions & 5 deletions scorer/verifications/seed_connected.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
PENALTY = 3

db = ArangoClient(hosts=config.ARANGO_SERVER).db('_system')
snapshot_db = ArangoClient(hosts=config.ARANGO_SERVER).db('snapshot')


def seed_connections(group_id, after):
cursor = snapshot_db['usersInGroups'].find({'_to': group_id})
cursor = db['usersInGroups'].find({'_to': group_id})
members = [ug['_from'] for ug in cursor]
return snapshot_db.aql.execute('''
return db.aql.execute('''
FOR c in connections
FILTER c._from IN @members
AND (c.timestamp > @after OR c.level == 'reported')
Expand Down Expand Up @@ -47,8 +46,8 @@ def verify(block):
for g in v['connected']:
counts[g] = counts.get(g, 0) + 1

prev_snapshot_time = snapshot_db['variables'].get('PREV_SNAPSHOT_TIME')['value']
seed_groups = snapshot_db['groups'].find({'seed': True})
prev_snapshot_time = db['variables'].get('PREV_SNAPSHOT_TIME')['value']
seed_groups = db['groups'].find({'seed': True})
for seed_group in seed_groups:
# load connection that members of this seed group made after
# previous snapshot
Expand Down