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
#354 Check result for errors (#355)
* #354 Check result for errors

* #354 get_measurements error -> warning

* #354 check for errors in get measurements

* #354 get measurements from bucked transactions

* #354 remove repeated code
  • Loading branch information
otselnik authored and vasiliy-zaznobin committed Dec 7, 2021
commit 56044eaf7ce4335104750884494e366559422c7a
49 changes: 41 additions & 8 deletions proxy/common_neon/solana_interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ def collect_results(self, receipts, eth_trx=None, reason=None):

@staticmethod
def extract_measurements_from_receipt(receipt):
if check_for_errors(receipt):
logger.warning("Can't get measurements from receipt with error")
logger.info("Failed result: %s"%json.dumps(receipt, indent=3))
return []

log_messages = receipt['result']['meta']['logMessages']
transaction = receipt['result']['transaction']
accounts = transaction['message']['accountKeys']
Expand Down Expand Up @@ -185,19 +190,47 @@ def extract_measurements_from_receipt(receipt):
return result


def check_if_program_exceeded_instructions(err_result):
err_instruction = "Program failed to complete: exceeded maximum number of instructions allowed"
err_budget = "failed: Computational budget exceeded"
def get_error_definition_from_reciept(receipt):
err_from_reciept = get_from_dict(receipt, 'result', 'meta', 'err', 'InstructionError')
if err_from_reciept is not None:
return err_from_reciept

err_from_reciept_result = get_from_dict(receipt, 'meta', 'err', 'InstructionError')
if err_from_reciept_result is not None:
return err_from_reciept_result

err_from_send_trx_error = get_from_dict(receipt, 'data', 'err', 'InstructionError')
if err_from_send_trx_error is not None:
return err_from_send_trx_error

err_from_prepared_receipt = get_from_dict(receipt, 'err', 'InstructionError')
if err_from_prepared_receipt is not None:
return err_from_prepared_receipt

return None



if err_result['data']['logs'][-1].find(err_instruction) >= 0 or \
err_result['data']['logs'][-2].find(err_instruction) >= 0 or \
err_result['data']['logs'][-1].find(err_budget) >= 0:
def check_for_errors(receipt):
if get_error_definition_from_reciept(receipt) is not None:
return True
return False


def check_if_storage_is_empty_error(err_result):
error_arr = get_from_dict(err_result, "data", "err", "InstructionError")
def check_if_program_exceeded_instructions(receipt):
error_arr = get_error_definition_from_reciept(receipt)
if error_arr is not None and isinstance(error_arr, list):
error_type = error_arr[1]
if isinstance(error_type, str):
if error_type == 'ProgramFailedToComplete':
return True
if error_type == 'ComputationalBudgetExceeded':
return True
return False


def check_if_storage_is_empty_error(receipt):
error_arr = get_error_definition_from_reciept(receipt)
if error_arr is not None and isinstance(error_arr, list):
error_dict = error_arr[1]
if isinstance(error_dict, dict) and 'Custom' in error_dict:
Expand Down
14 changes: 11 additions & 3 deletions proxy/common_neon/transaction_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .emulator_interactor import call_emulated
from .layouts import ACCOUNT_INFO_LAYOUT
from .neon_instruction import NeonInstruction
from .solana_interactor import SolanaInteractor, check_if_continue_returned, \
from .solana_interactor import SolanaInteractor, check_if_continue_returned, check_for_errors,\
check_if_program_exceeded_instructions, check_if_storage_is_empty_error
from ..environment import EVM_LOADER_ID
from ..plugin.eth_proto import Trx as EthTrx
Expand Down Expand Up @@ -321,6 +321,12 @@ def call_signed_noniterative(self):
call_txs_05.add(self.create_acc_trx)
call_txs_05.add(self.instruction.make_noniterative_call_transaction(len(call_txs_05.instructions)))
result = self.sender.send_measured_transaction(call_txs_05, self.eth_trx, 'CallFromRawEthereumTX')

if check_for_errors(result):
if check_if_program_exceeded_instructions(result):
raise Exception("Program failed to complete")
raise Exception(json.dumps(result['result']['meta']))

return result['result']['transaction']['signatures'][0]


Expand Down Expand Up @@ -359,7 +365,9 @@ def create_accounts_for_trx(self):
logger.debug(f"Create account for trx: {length}")
precall_txs = Transaction()
precall_txs.add(self.create_acc_trx)
self.sender.send_measured_transaction(precall_txs, self.eth_trx, 'CreateAccountsForTrx')
result = self.sender.send_measured_transaction(precall_txs, self.eth_trx, 'CreateAccountsForTrx')
if check_for_errors(result):
raise Exception("Failed to create account for trx")


def write_trx_to_holder_account(self):
Expand Down Expand Up @@ -493,7 +501,7 @@ def collect_bucked_results(self, receipts, reason):
logger.debug(f"Collected bucked results: {receipts}")
result_list = self.sender.collect_results(receipts, eth_trx=self.eth_trx, reason=reason)
for result in result_list:
# self.sender.get_measurements(result)
self.sender.get_measurements(result)
signature = check_if_continue_returned(result)
if signature:
return signature