walker bugfix

This commit is contained in:
Tim
2024-04-04 00:00:43 -04:00
parent 34359155e1
commit 9103bf4214
3 changed files with 3 additions and 4 deletions

View File

@@ -1 +0,0 @@
{"42161":{"t":[{"a":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","n":"Wrapped Ether","s":"WETH","d":18},{"a":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","n":"USD Coin (Arbitrum Native)","s":"USDC","d":6},{"a":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f","n":"Wrapped BTC","s":"WBTC","d":8},{"a":"0x912CE59144191C1204E64559FE8253a0e49E6548","n":"Arbitrum","s":"ARB","d":18},{"a":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","n":"ChainLink Token","s":"LINK","d":18},{"a":"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0","n":"Uniswap","s":"UNI","d":18}],"p":[{"a":"0x2f5e87C9312fa29aed5c179E456625D79015299c","b":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f","q":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","f":500,"e":1,"d":-10},{"a":"0x0d94947374cbc779a0FB4D1bfF795C0Af6Dfae25","b":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","q":"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0","f":10000,"e":1,"d":-12},{"a":"0x689C96ceAb93f5E131631D225D75DeA3fD37747E","b":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f","q":"0x912CE59144191C1204E64559FE8253a0e49E6548","f":3000,"e":1,"d":-10},{"a":"0x0E4831319A50228B9e450861297aB92dee15B44F","b":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f","q":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","f":500,"e":1,"d":2},{"a":"0x2038eEAa7100E08739352a37Ed67852E8529E8ED","b":"0x912CE59144191C1204E64559FE8253a0e49E6548","q":"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0","f":10000,"e":1,"d":0},{"a":"0x468b88941e7Cc0B88c1869d68ab6b570bCEF62Ff","b":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","q":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","f":3000,"e":1,"d":0},{"a":"0xC24f7d8E51A64dc1238880BD00bb961D54cbeb29","b":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","q":"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0","f":3000,"e":1,"d":0},{"a":"0xbBe36e6f0331C6a36AB44Bc8421E28E1a1871C1e","b":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","q":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","f":3000,"e":1,"d":-12},{"a":"0xC6962004f452bE9203591991D15f6b388e09E8D0","b":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","q":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","f":500,"e":1,"d":12},{"a":"0xa79fD76cA2b24631Ec3151f10c0660a30Bc946E7","b":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f","q":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","f":3000,"e":1,"d":-10},{"a":"0xb0f6cA40411360c03d41C5fFc5F179b8403CdcF8","b":"0x912CE59144191C1204E64559FE8253a0e49E6548","q":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","f":500,"e":1,"d":12},{"a":"0xC6F780497A95e246EB9449f5e4770916DCd6396A","b":"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1","q":"0x912CE59144191C1204E64559FE8253a0e49E6548","f":500,"e":1,"d":0},{"a":"0x8b6149aF984140BD3F8e158CcDCD05984a4ad0f5","b":"0x912CE59144191C1204E64559FE8253a0e49E6548","q":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","f":3000,"e":1,"d":0},{"a":"0xEd701Ba0cec723d85B7d96c80C21148E49D2Bf05","b":"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4","q":"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0","f":10000,"e":1,"d":0}]}}

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@ from dexorder.blockstate import current_blockstate
from dexorder.blockstate.branch import Branch
from dexorder.blockstate.fork import Fork, current_fork
from dexorder.blockstate.state import FinalizedBlockState
from dexorder.base.block import Block, BlockInfo
from dexorder.base.block import Block, BlockInfo, latest_block
from dexorder.progressor import BlockProgressor
from dexorder.util.async_util import Maywaitable
@@ -69,6 +69,7 @@ class BlockWalker (BlockProgressor):
try:
latest_blockdata: BlockInfo = await w3.eth.get_block('latest')
latest = Block(chain_id, latest_blockdata)
latest_block[chain_id] = latest
if prev_height is None or latest.height > prev_height:
prev_height = latest.height
log.debug(f'polled new block {latest.height}')
@@ -83,7 +84,7 @@ class BlockWalker (BlockProgressor):
self.flush_type=='blocks' and last_flush + self.flush_delay <= processed_height or \
self.flush_type=='time' and last_flush + self.flush_delay <= now():
if self.flush_callback is not None:
self.flush_callback()
await self.flush_callback()
# flush height to db
db.kv[kv_key] = cur_height
if self.flush_type=='blocks':