From 7a4f4c485f9933cb43d1e9c8b2768f15e36ffb94 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Jan 2024 23:04:09 -0400 Subject: [PATCH] alpha touchup --- src/dexorder/base/chain.py | 2 +- src/dexorder/runner.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dexorder/base/chain.py b/src/dexorder/base/chain.py index d101f33..154e2ea 100644 --- a/src/dexorder/base/chain.py +++ b/src/dexorder/base/chain.py @@ -47,7 +47,7 @@ Mumbai = Blockchain(80001, 'Mumbai') BSC = Blockchain(56, 'BSC') Arbitrum = Blockchain(42161, 'Arbitrum', 3, batch_size=1000) # todo configure batch size... does it depend on log count? :( Mock = Blockchain(31337, 'Mock', 3, batch_size=10000) -Alpha = Blockchain(1337, 'Dexorder Alpha', 3, batch_size=10000) +Alpha = Blockchain(1337, 'Dexorder Alpha', 3, batch_size=100) current_chain = ContextVar[Blockchain]('current_chain') diff --git a/src/dexorder/runner.py b/src/dexorder/runner.py index 41da3cb..c6ad7fb 100644 --- a/src/dexorder/runner.py +++ b/src/dexorder/runner.py @@ -71,12 +71,15 @@ class BlockStateRunner: async def run_ws(self): """ + + NOTE: This doc is old and not strictly true but still the basic idea + 1. load root stateBlockchain a. if no root, init from head b. if root is old, batch forward by height 2. discover new heads 2b. find in-state parent block else use root - 3. context = ancestor->head diff + 3. fork = ancestor->head diff 4. query global log filter 5. process new vaults 6. process new orders and cancels