Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e496b27
VERSION = (0, 4, 0)
vasiliy-zaznobin Nov 16, 2021
fe41d64
EVM_LOADER_REVISION:=v0.4.0
vasiliy-zaznobin Nov 16, 2021
5467c50
EVM_LOADER_REVISION:=stable
vasiliy-zaznobin Nov 16, 2021
3c6f4bc
289 implement eth get storage at (#298)
ivandzen Nov 18, 2021
6e1864e
#256 create and airdrop eth account (#259)
rozhkovdmitrii Nov 18, 2021
4880060
#305 Remove extra args from ether2program (#309)
rozhkovdmitrii Nov 19, 2021
531a9e2
Change default logDB postgress pass (#317)
rozhkovdmitrii Nov 23, 2021
6f3cf9a
#311 Create account and airdrop on gas estimation if it's preset
rozhkovdmitrii Nov 24, 2021
452a86d
neonbals/neon-evm#371 Update STORAGE_ACCOUNT_INFO_LAYOUT (#315)
sinev-valentine Nov 24, 2021
08ebfbc
319 add neon cli version handler (#325)
vasiliy-zaznobin Nov 24, 2021
fb01a4e
fix storage account check (#327)
sinev-valentine Nov 24, 2021
ed83d90
#320 add neon proxy version handler (#323)
vasiliy-zaznobin Nov 25, 2021
dea01f4
313 concurrent execution of solana program dump (#314)
ivandzen Nov 25, 2021
024bf02
fix scripts (#329)
ivandzen Nov 25, 2021
cf9112d
#318 JSON_RPC "params" field may be omitted (#322)
mich-master Nov 26, 2021
fa9e43e
#336 indexer refactoring (#340)
ivandzen Dec 2, 2021
c7ef793
#333 fix indexer errors (#334)
otselnik Dec 2, 2021
e74e568
#291 Proxy refactoring (#324)
otselnik Dec 2, 2021
d5a5015
#337 сreate base airdropper service (#343)
ivandzen Dec 3, 2021
50bc6ba
#337 fix running airdropper (#347)
ivandzen Dec 6, 2021
a619b66
#351 fix canceller droping running transactions (#352)
otselnik Dec 6, 2021
d2f8817
349 improve neon proxy logging to filter a request and the correspond…
vasiliy-zaznobin Dec 6, 2021
5d6dab2
#349 Fix using log sending solana transaction (#353)
vasiliy-zaznobin Dec 6, 2021
4045e90
#295 iterative execution (#332)
otselnik Dec 6, 2021
521696f
#354 Check result for errors (#355)
otselnik Dec 7, 2021
fff455e
#360 pass transaction too large upper (#361)
otselnik Dec 7, 2021
e15d847
Merge remote-tracking branch 'origin/develop'
vasiliy-zaznobin Dec 7, 2021
2416591
NEON_PROXY_PKG_VERSION = '0.5.0'
vasiliy-zaznobin Dec 7, 2021
168e428
VERSION = (0, 4, 0)
vasiliy-zaznobin Nov 16, 2021
3125645
EVM_LOADER_REVISION:=v0.4.0
vasiliy-zaznobin Nov 16, 2021
07f175d
EVM_LOADER_REVISION:=stable
vasiliy-zaznobin Nov 16, 2021
0bbb26b
289 implement eth get storage at (#298)
ivandzen Nov 18, 2021
7841b07
#256 create and airdrop eth account (#259)
rozhkovdmitrii Nov 18, 2021
ce05c81
#305 Remove extra args from ether2program (#309)
rozhkovdmitrii Nov 19, 2021
6ca860a
Change default logDB postgress pass (#317)
rozhkovdmitrii Nov 23, 2021
b3b322f
#311 Create account and airdrop on gas estimation if it's preset
rozhkovdmitrii Nov 24, 2021
c860ed0
neonbals/neon-evm#371 Update STORAGE_ACCOUNT_INFO_LAYOUT (#315)
sinev-valentine Nov 24, 2021
9bb3f89
319 add neon cli version handler (#325)
vasiliy-zaznobin Nov 24, 2021
081bc75
fix storage account check (#327)
sinev-valentine Nov 24, 2021
7845ca9
#320 add neon proxy version handler (#323)
vasiliy-zaznobin Nov 25, 2021
f299c57
313 concurrent execution of solana program dump (#314)
ivandzen Nov 25, 2021
0a5dc2d
fix scripts (#329)
ivandzen Nov 25, 2021
7964cad
#318 JSON_RPC "params" field may be omitted (#322)
mich-master Nov 26, 2021
01df8a4
#336 indexer refactoring (#340)
ivandzen Dec 2, 2021
d9a8e51
#333 fix indexer errors (#334)
otselnik Dec 2, 2021
f4b178c
#291 Proxy refactoring (#324)
otselnik Dec 2, 2021
5ced809
#337 сreate base airdropper service (#343)
ivandzen Dec 3, 2021
ae7b392
#337 fix running airdropper (#347)
ivandzen Dec 6, 2021
9feca6a
#351 fix canceller droping running transactions (#352)
otselnik Dec 6, 2021
2f0a0df
349 improve neon proxy logging to filter a request and the correspond…
vasiliy-zaznobin Dec 6, 2021
3b36864
#349 Fix using log sending solana transaction (#353)
vasiliy-zaznobin Dec 6, 2021
6bb8509
#295 iterative execution (#332)
otselnik Dec 6, 2021
56044ea
#354 Check result for errors (#355)
otselnik Dec 7, 2021
0bad34c
#360 pass transaction too large upper (#361)
otselnik Dec 7, 2021
9e8344c
NEON_PROXY_PKG_VERSION = '0.5.0'
vasiliy-zaznobin Dec 7, 2021
981c178
Merge remote-tracking branch 'origin/develop->master_0.5.0' into deve…
vasiliy-zaznobin Dec 7, 2021
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
Prev Previous commit
Next Next commit
#333 fix indexer errors (#334)
* #333 fix continue blocked accounts

* #333 continue_table fixes

* #333 fixes

* #333 remove filling db to lent indexer work properly

* #333 sync
  • Loading branch information
otselnik authored Dec 2, 2021
commit c7ef79351480f18e72fdcf6666dd110b384afd2a
59 changes: 44 additions & 15 deletions proxy/indexer/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def process_receipts(self):
# logger.debug("rlp.exceptions.RLPException")
pass
except Exception as err:
if str(err).startswith("unhashable type"):
# logger.debug("unhashable type")
if str(err).startswith("nonhashable type"):
# logger.debug("nonhashable type")
pass
elif str(err).startswith("unsupported operand type"):
# logger.debug("unsupported operand type")
Expand Down Expand Up @@ -268,9 +268,9 @@ def process_receipts(self):
continue_result = continue_table[storage_account]
if continue_result.accounts != blocked_accounts:
logger.error("Strange behavior. Pay attention. BLOCKED ACCOUNTS NOT EQUAL")
continue_result.signatures.append(signature)
trx_table[eth_signature].got_result = continue_result.results
trx_table[eth_signature].signatures = continue_result.signatures
trx_table[eth_signature].signatures += continue_result.signatures

del continue_table[storage_account]

elif instruction_data[0] == 0x0a or instruction_data[0] == 0x14: # Continue or ContinueV02
Expand All @@ -281,14 +281,14 @@ def process_receipts(self):
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][5:]]
if instruction_data[0] == 0x14:
# logger.debug("{:>10} {:>6} ContinueV02 0x{}".format(slot, counter, instruction_data.hex()))
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][5:]]
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][6:]]
got_result = get_trx_results(trx)

if storage_account in continue_table:
continue_table[storage_account].signatures.append(signature)

if got_result:
if continue_table[storage_account].results:
if got_result is not None:
if continue_table[storage_account].results is not None:
logger.error("Strange behavior. Pay attention. RESULT ALREADY EXISTS IN CONTINUE TABLE")
if continue_table[storage_account].accounts != blocked_accounts:
logger.error("Strange behavior. Pay attention. BLOCKED ACCOUNTS NOT EQUAL")
Expand All @@ -305,10 +305,8 @@ def process_receipts(self):
# logger.debug("{:>10} {:>6} ExecuteTrxFromAccountDataIterativeV02 0x{}".format(slot, counter, instruction_data.hex()))
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][7:]]


holder_account = trx['transaction']['message']['accountKeys'][instruction['accounts'][0]]
storage_account = trx['transaction']['message']['accountKeys'][instruction['accounts'][1]]
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][5:]]

if storage_account in continue_table:
continue_table[storage_account].signatures.append(signature)
Expand All @@ -328,7 +326,9 @@ def process_receipts(self):
# logger.debug("{:>10} {:>6} Cancel 0x{}".format(slot, counter, instruction_data.hex()))

storage_account = trx['transaction']['message']['accountKeys'][instruction['accounts'][0]]
continue_table[storage_account] = ContinueStruct(signature, ([], "0x0", 0, [], trx['slot']))
blocked_accounts = [trx['transaction']['message']['accountKeys'][acc_idx] for acc_idx in instruction['accounts'][6:]]

continue_table[storage_account] = ContinueStruct(signature, ([], "0x0", 0, [], trx['slot']), blocked_accounts)

elif instruction_data[0] == 0x0d:
# logger.debug("{:>10} {:>6} PartialCallOrContinueFromRawEthereumTX 0x{}".format(slot, counter, instruction_data.hex()))
Expand Down Expand Up @@ -360,6 +360,14 @@ def process_receipts(self):
slot
)

if storage_account in continue_table:
continue_result = continue_table[storage_account]
trx_table[eth_signature].signatures += continue_result.signatures
if continue_result.results is not None:
trx_table[eth_signature].got_result = continue_result.results

del continue_table[storage_account]

elif instruction_data[0] == 0x0e:
# logger.debug("{:>10} {:>6} ExecuteTrxFromAccountDataIterativeOrContinue 0x{}".format(slot, counter, instruction_data.hex()))

Expand All @@ -379,7 +387,7 @@ def process_receipts(self):
logger.error("Strange behavior. Pay attention. HOLDER ACCOUNT NOT FOUND")
holder_table[holder_account] = HolderStruct(storage_account)

if got_result:
if got_result is not None:
if continue_table[storage_account].results:
logger.error("Strange behavior. Pay attention. RESULT ALREADY EXISTS IN CONTINUE TABLE")
if continue_table[storage_account].accounts != blocked_accounts:
Expand All @@ -396,11 +404,15 @@ def process_receipts(self):
pass

for eth_signature, trx_struct in trx_table.items():
if trx_struct.got_result:
if trx_struct.got_result is not None:
self.submit_transaction(trx_struct)
elif trx_struct.storage:
if abs(trx_struct.slot - self.current_slot) > CANCEL_TIMEOUT:
self.blocked_storages[trx_struct.storage] = (trx_struct.eth_trx, trx_struct.blocked_accounts)
elif trx_struct.storage is not None:
if not self.submit_transaction_part(trx_struct):
if abs(trx_struct.slot - self.current_slot) > CANCEL_TIMEOUT:
logger.debug("Probably blocked")
logger.debug(trx_struct.eth_signature)
logger.debug(trx_struct.signatures)
self.blocked_storages[trx_struct.storage] = (trx_struct.eth_trx, trx_struct.blocked_accounts)
else:
logger.error(trx_struct)

Expand Down Expand Up @@ -433,6 +445,23 @@ def submit_transaction(self, trx_struct):
logger.debug(trx_struct.eth_signature + " " + status)


def submit_transaction_part(self, trx_struct):
''' Check if transaction was allready submitted by proxy. '''
eth_signature = trx_struct.eth_signature
ethereum_trx = self.ethereum_trx.get(eth_signature, None)
if ethereum_trx is not None:
signatures = self.eth_sol_trx.get(eth_signature, [])
signatures = signatures + trx_struct.signatures
self.eth_sol_trx[eth_signature] = signatures
for idx, sig in enumerate(signatures):
self.sol_eth_trx[sig] = {
'idx': idx,
'eth': eth_signature,
}
return True
return False


def gather_blocks(self):
max_slot = self.client.get_slot(commitment="recent")["result"]

Expand Down
4 changes: 4 additions & 0 deletions proxy/indexer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ def unlock_accounts(self, blocked_storages):
if blocked_accs is None:
logger.error("blocked_accs is None")
continue
if acc_list is None:
logger.error("acc_list is None. Storage is empty")
logger.error(storage)
continue

eth_trx = rlp.decode(bytes.fromhex(eth_trx), EthTrx)
if acc_list != blocked_accs:
Expand Down