Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8d079ed
introduce logged_based
Dec 27, 2021
4b609b1
Get used with logged_group
Dec 29, 2021
a63d17d
Provide logged group on the rest of code base
Dec 29, 2021
4c3ffad
Merge remote-tracking branch 'origin/develop' into 422_introduce_logg…
Dec 29, 2021
b4eda35
Add Airdropper logged_group
Dec 29, 2021
8275f07
Spit and polish
Dec 29, 2021
b3ecaae
Spit and polish
Dec 29, 2021
c8d51ff
Spit and polish
Dec 29, 2021
e5854f4
Spit and polish
Dec 29, 2021
1c36d89
Spit and polish
Dec 29, 2021
bea6cfa
Spit and polish
Dec 29, 2021
465754e
Spit and polish
Dec 29, 2021
f7a055a
rollback proxy.py
Dec 29, 2021
c345177
spit and polish
Dec 29, 2021
ab79eb0
Remove log_level param from airdropper
Dec 29, 2021
76f914e
Spit and polish
Dec 29, 2021
c5cbdba
Fix indexer base init error
Dec 29, 2021
ee87cb7
Fix indexer base init error
Dec 29, 2021
1218d78
Reduce Airdropper level
Dec 30, 2021
523e44f
roll back get_measurements prefix
Dec 30, 2021
dcdf481
Get logged-groups package from different place
Dec 30, 2021
13242b0
install git to resolve python dependency
Dec 30, 2021
b32b936
Spit on Dockerfile and polish
Dec 30, 2021
35a51b7
Fix get_measurements errors parsig command
Dec 30, 2021
5372136
Merge remote-tracking branch 'origin/develop' into 422_introduce_logg…
Dec 30, 2021
125c56e
Polish after merge
Dec 30, 2021
3f759ac
Fix
Dec 30, 2021
3862077
fix
Dec 30, 2021
a7b1de2
fix
Dec 30, 2021
ed83fe6
Merge branch 'develop' into 422_introduce_logged_groups
Jan 10, 2022
440ba11
fix
Jan 10, 2022
7989afb
fix
Jan 10, 2022
ccdd299
spit and polish
Jan 10, 2022
0b81aca
fix errors
Jan 11, 2022
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
Remove log_level param from airdropper
  • Loading branch information
rozhkovdmitrii committed Dec 29, 2021
commit ab79eb0499e3c2700bea17301bcacf8bd633bc78
2 changes: 0 additions & 2 deletions proxy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
wrapper_whitelist = os.environ['INDEXER_ERC20_WRAPPER_WHITELIST']
if wrapper_whitelist != 'ANY':
wrapper_whitelist = wrapper_whitelist.split(',')
log_level = os.environ['LOG_LEVEL']
price_update_interval = int(os.environ.get('PRICE_UPDATE_INTERVAL', '60'))
neon_decimals = int(os.environ.get('NEON_DECIMALS', '9'))

Expand All @@ -41,7 +40,6 @@
evm_loader_id,
faucet_url,
wrapper_whitelist,
log_level,
price_update_interval,
neon_decimals,
start_slot)
Expand Down
23 changes: 1 addition & 22 deletions proxy/common_neon/transaction_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(self, solana_interactor: SolanaInteractor, eth_trx: EthTrx, steps:

self.instruction = NeonInstruction(self.sender.get_operator_key())


def execute(self):
self.create_account_list_by_emulate()

Expand Down Expand Up @@ -81,21 +80,17 @@ def execute(self):
finally:
self.free_perm_accs()


def create_instruction_constructor(self):
return NeonInstruction(self.sender.get_operator_key(), self.eth_trx, self.eth_accounts, self.caller_token)


def create_noniterative_executor(self):
self.instruction.init_eth_trx(self.eth_trx, self.eth_accounts, self.caller_token)
return NoniterativeTransactionSender(self.sender, self.instruction, self.create_acc_trx, self.eth_trx)


def create_iterative_executor(self):
self.instruction.init_iterative(self.storage, self.holder, self.perm_accs_id)
return IterativeTransactionSender(self.sender, self.instruction, self.create_acc_trx, self.eth_trx, self.steps, self.steps_emulated)


def init_perm_accs(self):
while True:
with new_acc_id_glob.get_lock():
Expand Down Expand Up @@ -125,13 +120,11 @@ def init_perm_accs(self):
else:
break


def free_perm_accs(self):
self.debug("FREE RESOURCES {}".format(self.perm_accs_id))
with new_acc_id_glob.get_lock():
acc_list_glob.append(self.perm_accs_id)


def create_account_with_seed(self, seed, storage_size):
account = accountWithSeed(self.sender.get_operator_key(), seed)

Expand All @@ -145,7 +138,6 @@ def create_account_with_seed(self, seed, storage_size):

return account


def create_multiple_accounts_with_seed(self, seeds: List[bytes], sizes: List[int]) -> List[PublicKey]:
accounts = list(map(lambda seed: accountWithSeed(self.sender.get_operator_key(), seed), seeds))
accounts_info = self.sender.get_multiple_accounts_info(accounts)
Expand All @@ -170,7 +162,6 @@ def create_multiple_accounts_with_seed(self, seeds: List[bytes], sizes: List[int

return accounts


def create_account_list_by_emulate(self):
sender_ether = bytes.fromhex(self.eth_trx.sender())
add_keys_05 = []
Expand Down Expand Up @@ -304,7 +295,6 @@ def __init__(self, solana_interactor: SolanaInteractor, neon_instruction: NeonIn
self.create_acc_trx = create_acc_trx
self.eth_trx = eth_trx


def call_signed_noniterative(self):
call_txs_05 = Transaction()
if len(self.create_acc_trx.instructions) > 0:
Expand All @@ -320,6 +310,7 @@ def call_signed_noniterative(self):
return result['result']['transaction']['signatures'][0]


@logged_group("Proxy")
class IterativeTransactionSender:
CONTINUE_REGULAR = 'ContinueV02'
CONTINUE_COMBINED = 'PartialCallOrContinueFromRawEthereumTX'
Expand All @@ -334,7 +325,6 @@ def __init__(self, solana_interactor: SolanaInteractor, neon_instruction: NeonIn
self.steps_emulated = steps_emulated
self.instruction_type = self.CONTINUE_REGULAR


def call_signed_iterative_combined(self):
if len(self.create_acc_trx.instructions) > 0:
create_accounts_siganture = self.sender.send_transaction_unconfirmed(self.create_acc_trx)
Expand All @@ -344,7 +334,6 @@ def call_signed_iterative_combined(self):
self.instruction_type = self.CONTINUE_COMBINED
return self.call_continue()


def call_signed_with_holder_combined(self):
precall_transactions = self.make_write_to_holder_account_trx()
if len(self.create_acc_trx.instructions) > 0:
Expand All @@ -357,7 +346,6 @@ def call_signed_with_holder_combined(self):
self.instruction_type = self.CONTINUE_HOLDER_COMB
return self.call_continue()


def make_write_to_holder_account_trx(self) -> List[Transaction]:
self.debug('write_trx_to_holder_account')
msg = self.eth_trx.signature() + len(self.eth_trx.unsigned_msg()).to_bytes(8, byteorder="little") + self.eth_trx.unsigned_msg()
Expand All @@ -373,7 +361,6 @@ def make_write_to_holder_account_trx(self) -> List[Transaction]:

return trxs


def call_continue(self):
return_result = None
try:
Expand All @@ -388,7 +375,6 @@ def call_continue(self):

return self.call_continue_iterative()


def call_continue_iterative(self):
try:
return self.call_continue_step_by_step()
Expand All @@ -398,7 +384,6 @@ def call_continue_iterative(self):

return self.call_cancel()


def call_continue_step_by_step(self):
while True:
self.debug("Continue iterative step:")
Expand All @@ -407,7 +392,6 @@ def call_continue_step_by_step(self):
if signature is not None:
return signature


def call_continue_step(self):
step_count = self.steps
while step_count > 0:
Expand All @@ -424,15 +408,13 @@ def call_continue_step(self):
raise
raise Exception("Can't execute even one EVM instruction")


def call_cancel(self):
trx = self.instruction.make_cancel_transaction()

self.debug("Cancel")
result = self.sender.send_measured_transaction(trx, self.eth_trx, 'CancelWithNonce')
return result['result']['transaction']['signatures'][0]


def call_continue_bucked(self):
self.debug("Send bucked combined: %s", self.instruction_type)
receipts = []
Expand All @@ -449,7 +431,6 @@ def call_continue_bucked(self):

return self.collect_bucked_results(receipts, self.instruction_type)


def addition_count(self):
'''
How many transactions are needed depending on trx type:
Expand All @@ -464,7 +445,6 @@ def addition_count(self):
addition_count = 1
return addition_count


def make_combined_trx(self, steps, index):
if self.instruction_type == self.CONTINUE_COMBINED:
return self.instruction.make_partial_call_or_continue_transaction(steps - index)
Expand All @@ -473,7 +453,6 @@ def make_combined_trx(self, steps, index):
else:
raise Exception("Unknown continue type: {}".format(self.instruction_type))


def collect_bucked_results(self, receipts, reason):
self.debug(f"Collected bucked results: {receipts}")
result_list = self.sender.collect_results(receipts, eth_trx=self.eth_trx, reason=reason)
Expand Down
1 change: 0 additions & 1 deletion proxy/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ services:
FAUCET_URL: http://faucet:3333
NEON_CLI_TIMEOUT: 0.9
INDEXER_ERC20_WRAPPER_WHITELIST: ANY
LOG_LEVEL: INFO
PRICE_UPDATE_INTERVAL: 10
START_SLOT: LATEST
hostname: airdropper
Expand Down
6 changes: 1 addition & 5 deletions proxy/indexer/airdropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ def __init__(self,
evm_loader_id,
faucet_url = '',
wrapper_whitelist = 'ANY',
log_level = 'INFO',
price_upd_interval=60,
neon_decimals = 9,
start_slot = 0):
IndexerBase.__init__(self, solana_url, evm_loader_id, log_level, start_slot)
IndexerBase.__init__(self, solana_url, evm_loader_id, start_slot)

# collection of eth-address-to-create-accout-trx mappings
# for every addresses that was already funded with airdrop
Expand Down Expand Up @@ -167,7 +166,6 @@ def run_airdropper(solana_url,
evm_loader_id,
faucet_url = '',
wrapper_whitelist = 'ANY',
log_level = 'INFO',
price_update_interval = 60,
neon_decimals = 9,
start_slot = 0, *, logger):
Expand All @@ -176,7 +174,6 @@ def run_airdropper(solana_url,
logger.info(f"""Running indexer with params:
solana_url: {solana_url},
evm_loader_id: {evm_loader_id},
log_level: {log_level},
faucet_url: {faucet_url},
wrapper_whitelist: {wrapper_whitelist},
price update interval: {price_update_interval},
Expand All @@ -186,7 +183,6 @@ def run_airdropper(solana_url,
evm_loader_id,
faucet_url,
wrapper_whitelist,
log_level,
price_update_interval,
neon_decimals,
start_slot)
Expand Down
1 change: 0 additions & 1 deletion proxy/indexer/indexer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class IndexerBase:
def __init__(self,
solana_url,
evm_loader_id,
log_level,
start_slot):

self.evm_loader_id = evm_loader_id
Expand Down