Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
90a4e56
#291 extract transaction sender class
otselnik Nov 14, 2021
143913b
#291 move perm accs to transaction sender
otselnik Nov 16, 2021
16c9bff
#291 fix state
otselnik Nov 22, 2021
f2c0303
#291 fix errors
otselnik Nov 23, 2021
57f3b53
Merge remote-tracking branch 'origin/develop' into 291_proxy_refactoring
otselnik Nov 23, 2021
3369f67
#291 merge fixes
otselnik Nov 23, 2021
af721bb
#291 refactoring
otselnik Nov 23, 2021
e512bb8
#291 move EXTRA_GAS to environment
otselnik Nov 23, 2021
8dc5e29
#291 capitalize CONFIRMATION_CHECK_DELAY
otselnik Nov 23, 2021
8dce2a5
#291 sort imports
otselnik Nov 23, 2021
cef8f21
#291 relative paths
otselnik Nov 24, 2021
1bf8383
#291 Should be fixed in #326
otselnik Nov 24, 2021
9672438
#291 testing chnages
otselnik Nov 24, 2021
2d42b73
fix storage account check
sinev-valentine Nov 24, 2021
ac2755c
Merge remote-tracking branch 'origin/develop' into 291_proxy_refactoring
otselnik Nov 24, 2021
3519c61
Merge branch '371_add_FinalizedStorage_to_check' into 291_proxy_refac…
otselnik Nov 24, 2021
bf313a2
#291 rename `trx_with_create_and_airdrop` -> `make_trx_with_create_an…
otselnik Nov 24, 2021
3093fcc
Merge remote-tracking branch 'origin/develop' into 291_proxy_refactoring
otselnik Nov 24, 2021
e3c4e33
#295 fix state
otselnik Nov 24, 2021
9b57e53
#291 iterative combined
otselnik Nov 25, 2021
ccffcf4
#295 do not get measurments
otselnik Nov 25, 2021
4d685db
#291 pull request fixes
otselnik Nov 25, 2021
6f63338
Merge remote-tracking branch 'origin/develop' into 291_proxy_refactoring
otselnik Nov 25, 2021
4546926
Merge branch '291_proxy_refactoring' into 295_iterative_execution
otselnik Nov 25, 2021
7befc6b
#295 turn combined instructions ON
otselnik Nov 29, 2021
b5010f8
#295 make neon_instructions return transasactions
otselnik Nov 29, 2021
5ebf76a
Merge remote-tracking branch 'origin/develop' into 291_proxy_refactoring
otselnik Dec 2, 2021
b464b1e
#291 merge fix
otselnik Dec 2, 2021
79088c6
#295 get rid of `USE_COMBINED_START_CONTINUE`
otselnik Dec 2, 2021
52173a0
Merge branch '291_proxy_refactoring' into 295_iterative_execution
otselnik Dec 2, 2021
4fe15e9
#295 requested fixes
otselnik Dec 2, 2021
607e74e
Merge remote-tracking branch 'origin/develop' into 295_iterative_exec…
otselnik Dec 2, 2021
d9f762a
#295 call_continue_bucked refactoring
otselnik Dec 2, 2021
842ec7d
#295 fix
otselnik Dec 3, 2021
78de121
#295 leave only combined iterative transactions
otselnik Dec 3, 2021
47cf219
#295 move constants into class
otselnik Dec 3, 2021
0eebc1f
#295 refactoring
otselnik Dec 3, 2021
cec7a38
Merge remote-tracking branch 'origin/develop' into 295_iterative_exec…
otselnik Dec 6, 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
#291 sort imports
  • Loading branch information
otselnik committed Nov 23, 2021
commit 8dce2a589bd254cb1e9675cf7c779b04e62a2787
7 changes: 4 additions & 3 deletions proxy/common_neon/address.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import logging
import random

from eth_keys import keys as eth_keys
from hashlib import sha256
from typing import NamedTuple
from solana.publickey import PublicKey
from eth_keys import keys as eth_keys
from spl.token.instructions import get_associated_token_address
from typing import NamedTuple

from proxy.environment import neon_cli, ETH_TOKEN_MINT_ID, EVM_LOADER_ID
from proxy.common_neon.layouts import ACCOUNT_INFO_LAYOUT
from proxy.environment import neon_cli, ETH_TOKEN_MINT_ID, EVM_LOADER_ID


logger = logging.getLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions proxy/common_neon/costs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from ..indexer.sql_dict import POSTGRES_USER, POSTGRES_HOST, POSTGRES_DB, POSTGRES_PASSWORD
import psycopg2
import base58
from proxy.environment import EVM_LOADER_ID
import psycopg2

from proxy.environment import EVM_LOADER_ID
from proxy.indexer.sql_dict import POSTGRES_USER, POSTGRES_HOST, POSTGRES_DB, POSTGRES_PASSWORD

class SQLCost():
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion proxy/common_neon/emulator_interactor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import json
import logging

from proxy.common_neon.errors import EthereumError
from proxy.environment import neon_cli
from .errors import EthereumError


logger = logging.getLogger(__name__)
Expand Down
11 changes: 5 additions & 6 deletions proxy/common_neon/neon_instruction.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import eth_utils
import logging
import struct
import eth_utils
from construct import Bytes, Int8ul, Int64ul
from construct import Struct as cStruct

from sha3 import keccak_256
from solana._layouts.system_instructions import SYSTEM_INSTRUCTIONS_LAYOUT, InstructionType
from solana.publickey import PublicKey
from solana.system_program import SYS_PROGRAM_ID
from solana.sysvar import SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY
from solana.transaction import AccountMeta, TransactionInstruction, Transaction
from spl.token.constants import ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID
from spl.token.instructions import transfer2, Transfer2Params
from sha3 import keccak_256

from proxy.environment import EVM_LOADER_ID, ETH_TOKEN_MINT_ID , COLLATERAL_POOL_BASE, NEW_USER_AIRDROP_AMOUNT
from proxy.common_neon.constants import SYSVAR_INSTRUCTION_PUBKEY, INCINERATOR_PUBKEY, KECCAK_PROGRAM, COLLATERALL_POOL_MAX
from proxy.common_neon.address import accountWithSeed, ether2program, getTokenAddr
from proxy.common_neon.constants import SYSVAR_INSTRUCTION_PUBKEY, INCINERATOR_PUBKEY, KECCAK_PROGRAM, COLLATERALL_POOL_MAX
from proxy.common_neon.layouts import CREATE_ACCOUNT_LAYOUT
from proxy.environment import EVM_LOADER_ID, ETH_TOKEN_MINT_ID , COLLATERAL_POOL_BASE, NEW_USER_AIRDROP_AMOUNT


logger = logging.getLogger(__name__)
Expand Down
4 changes: 3 additions & 1 deletion proxy/common_neon/solana_interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import logging
import re
import time

from solana.rpc.commitment import Confirmed
from solana.rpc.types import TxOpts

from proxy.common_neon.costs import update_transaction_cost
from proxy.environment import EVM_LOADER_ID, CONFIRMATION_CHECK_DELAY
from .costs import update_transaction_cost


logger = logging.getLogger(__name__)
Expand Down
16 changes: 8 additions & 8 deletions proxy/common_neon/transaction_sender.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import json
import logging
import os
import time
import rlp
import time

from base58 import b58encode
from sha3 import keccak_256
from solana.publickey import PublicKey
from solana.rpc.api import SendTransactionError
from solana.sysvar import *
from solana.transaction import AccountMeta, Transaction

from proxy.environment import EVM_LOADER_ID
from proxy.plugin.eth_proto import Trx as EthTrx
from proxy.core.acceptor.pool import new_acc_id_glob, acc_list_glob

from proxy.common_neon.solana_interactor import SolanaInteractor, check_if_continue_returned, check_if_program_exceeded_instructions
from proxy.common_neon.emulator_interactor import call_emulated
from proxy.common_neon.neon_instruction import NeonInstruction
from proxy.common_neon.address import accountWithSeed, AccountInfo, getTokenAddr
from proxy.common_neon.constants import STORAGE_SIZE, EMPTY_STORAGE_TAG, ACCOUNT_SEED_VERSION
from proxy.common_neon.emulator_interactor import call_emulated
from proxy.common_neon.layouts import ACCOUNT_INFO_LAYOUT

from ..core.acceptor.pool import new_acc_id_glob, acc_list_glob
from proxy.common_neon.neon_instruction import NeonInstruction
from proxy.common_neon.solana_interactor import SolanaInteractor, check_if_continue_returned, check_if_program_exceeded_instructions
from proxy.environment import EVM_LOADER_ID
from proxy.plugin.eth_proto import Trx as EthTrx


logger = logging.getLogger(__name__)
Expand Down
8 changes: 5 additions & 3 deletions proxy/indexer/solana_receipts_update.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import base58
import rlp
import json
import logging
import os
import rlp
import time
import logging
from solana.rpc.api import Client

from multiprocessing.dummy import Pool as ThreadPool
from solana.rpc.api import Client
from typing import Dict, Union

from proxy.environment import SOLANA_URL, EVM_LOADER_ID


Expand Down
10 changes: 5 additions & 5 deletions proxy/indexer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import json
import logging
import os
import rlp
import psycopg2
import rlp
import subprocess

from eth_utils import big_endian_to_int
from ethereum.transactions import Transaction as EthTrx
from ethereum.utils import sha3
Expand All @@ -14,17 +15,16 @@
from solana.rpc.api import Client
from solana.rpc.commitment import Confirmed
from solana.rpc.types import TxOpts
from solana.system_program import SYS_PROGRAM_ID
from solana.sysvar import SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY
from solana.transaction import AccountMeta, Transaction, TransactionInstruction
from spl.token.constants import TOKEN_PROGRAM_ID
from spl.token.instructions import get_associated_token_address
from web3.auto.gethdev import w3
from solana.system_program import SYS_PROGRAM_ID
from solana.sysvar import SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY

from proxy.environment import SOLANA_URL, EVM_LOADER_ID, ETH_TOKEN_MINT_ID

from proxy.common_neon.constants import SYSVAR_INSTRUCTION_PUBKEY, INCINERATOR_PUBKEY, KECCAK_PROGRAM
from proxy.common_neon.layouts import STORAGE_ACCOUNT_INFO_LAYOUT
from proxy.environment import SOLANA_URL, EVM_LOADER_ID, ETH_TOKEN_MINT_ID


logger = logging.getLogger(__name__)
Expand Down
34 changes: 17 additions & 17 deletions proxy/plugin/solana_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
import base58
import copy
import json
import unittest
import eth_utils
import rlp
import os
import json
import logging
from typing import List, Tuple, Optional
from solana.account import Account as sol_Account
import rlp
import threading
import traceback
import unittest

from ..common.utils import build_http_response
from ..http.codes import httpStatusCodes
from ..http.parser import HttpParser
from ..http.websocket import WebsocketFrame
from ..http.server import HttpWebServerBasePlugin, httpProtocolTypes
from .eth_proto import Trx as EthTrx
from solana.account import Account as sol_Account
from solana.rpc.api import Client as SolanaClient, SendTransactionError as SolanaTrxError
import base58
import traceback
import threading
from .solana_rest_api_tools import getAccountInfo, \
call_signed, neon_config_load, get_token_balance_or_airdrop
from solana.rpc.commitment import Confirmed
from typing import List, Tuple, Optional
from web3 import Web3
from proxy.core.acceptor.pool import proxy_id_glob
from proxy.indexer.utils import get_trx_results, LogDB
from proxy.indexer.sql_dict import SQLDict
from proxy.environment import neon_cli, solana_cli, SOLANA_URL, MINIMAL_GAS_PRICE, EXTRA_GAS
from proxy.common_neon.emulator_interactor import call_emulated

from .eth_proto import Trx as EthTrx
from .solana_rest_api_tools import getAccountInfo, call_signed, neon_config_load, get_token_balance_or_airdrop
from proxy.common_neon.address import EthereumAddress
from proxy.common_neon.emulator_interactor import call_emulated
from proxy.common_neon.errors import EthereumError
from proxy.core.acceptor.pool import proxy_id_glob
from proxy.environment import neon_cli, solana_cli, SOLANA_URL, MINIMAL_GAS_PRICE, EXTRA_GAS
from proxy.indexer.sql_dict import SQLDict
from proxy.indexer.utils import get_trx_results, LogDB

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand Down
19 changes: 9 additions & 10 deletions proxy/plugin/solana_rest_api_tools.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import logging
import random
import base64
import logging

from datetime import datetime
from solana.account import Account as SolanaAccount
from solana.publickey import PublicKey
from solana.rpc.commitment import Confirmed
from solana.rpc.api import Client as SolanaClient
from solana.account import Account as SolanaAccount
from proxy.common_neon.neon_instruction import NeonInstruction

from solana.rpc.commitment import Confirmed

from proxy.environment import read_elf_params, TIMEOUT_TO_RELOAD_NEON_CONFIG, NEW_USER_AIRDROP_AMOUNT
from proxy.common_neon.transaction_sender import TransactionSender
from proxy.common_neon.solana_interactor import SolanaInteractor
from proxy.common_neon.address import ether2program, getTokenAddr, EthereumAddress, AccountInfo
from proxy.common_neon.layouts import ACCOUNT_INFO_LAYOUT
from proxy.common_neon.errors import SolanaAccountNotFoundError, SolanaErrors
from proxy.common_neon.layouts import ACCOUNT_INFO_LAYOUT
from proxy.common_neon.neon_instruction import NeonInstruction
from proxy.common_neon.solana_interactor import SolanaInteractor
from proxy.common_neon.transaction_sender import TransactionSender
from proxy.common_neon.utils import get_from_dict
from proxy.environment import read_elf_params, TIMEOUT_TO_RELOAD_NEON_CONFIG, NEW_USER_AIRDROP_AMOUNT


logger = logging.getLogger(__name__)
Expand Down