Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
36173d3
Get rid of queue based service
rozhkovdmitrii Apr 16, 2022
30e11cf
Move all data types into data.py
rozhkovdmitrii Apr 16, 2022
cbfc8bb
Simplify start mechanism
rozhkovdmitrii Apr 16, 2022
5444085
Update neon_rpc_api_model
rozhkovdmitrii Apr 16, 2022
d956dc7
mempool init
rozhkovdmitrii Apr 16, 2022
a2ada65
update mempool
rozhkovdmitrii Apr 16, 2022
6e810fe
Get rid of second getting price int test_integration_success_read_price
rozhkovdmitrii Apr 16, 2022
4675a2c
Bring processing onto asyncio
rozhkovdmitrii Apr 17, 2022
76b73d7
Implement asyncio event loop on the MemPool
rozhkovdmitrii Apr 17, 2022
dc11a9d
rename mempool_server.py
rozhkovdmitrii Apr 17, 2022
89d63c8
Correct some things
rozhkovdmitrii Apr 17, 2022
6ae513b
Spit and polish
rozhkovdmitrii Apr 17, 2022
4bfd337
Spit and polish
rozhkovdmitrii Apr 17, 2022
7d49886
Merge branch '712-mempool' into 712-restructure-processing
rozhkovdmitrii Apr 17, 2022
817df22
Spit and polish
rozhkovdmitrii Apr 18, 2022
39ad9c9
Move pickable_data server into utils
rozhkovdmitrii Apr 18, 2022
22b0ac7
Merge branch '712-mempool' into 713-send-tx-from-mempool-worker
rozhkovdmitrii Apr 21, 2022
8b9a821
Introduce a variety of approaches to transfer a pickable data, config
rozhkovdmitrii Apr 21, 2022
017bcde
Spit on MemPool and polish a little
rozhkovdmitrii Apr 21, 2022
1df5786
Move transaction sending functionality
rozhkovdmitrii Apr 21, 2022
3b725ca
.
rozhkovdmitrii Apr 21, 2022
d4b68d7
Bring emulating beck to transaction_validator
rozhkovdmitrii Apr 21, 2022
df68f14
Resolve some remarks made by @a_falaleev
rozhkovdmitrii Apr 21, 2022
406aa6b
spit and polish
rozhkovdmitrii Apr 21, 2022
88376f8
Rename neon_tx_exec_cfg
rozhkovdmitrii Apr 21, 2022
971cb11
Turn down full test suite
rozhkovdmitrii Apr 22, 2022
9dc5d44
Save changes as they are
rozhkovdmitrii Apr 23, 2022
2c0f4eb
Fix pickable data client
rozhkovdmitrii Apr 23, 2022
b4e33e5
Spit ans polish
rozhkovdmitrii Apr 25, 2022
153f3a3
Move executor_mng out from MemPool
rozhkovdmitrii Apr 25, 2022
634b358
Merge branch '712-mempool' into 713-make-get_receipt-working
rozhkovdmitrii Apr 25, 2022
2464609
Move executor_mng out from MemPool
rozhkovdmitrii Apr 25, 2022
18af023
Merge branch '712-mempool' into 713-send-tx-from-mempool-worker
rozhkovdmitrii Apr 26, 2022
779019f
Get rid of endless request processing
rozhkovdmitrii Apr 26, 2022
f0d9f1a
Just reraise exception when failed to send
rozhkovdmitrii Apr 26, 2022
6dfc5d1
Just reraise exception when failed to send
rozhkovdmitrii Apr 26, 2022
dcf699b
Just reraise exception when failed to send
rozhkovdmitrii Apr 29, 2022
e78153b
Just try to fix logs
rozhkovdmitrii Apr 29, 2022
a467a3d
Logging logs
rozhkovdmitrii Apr 29, 2022
60b713a
Provide some extra logging
rozhkovdmitrii Apr 30, 2022
925d6b2
Just add address to eth_getLogs tests filter
rozhkovdmitrii May 1, 2022
f3c99bb
Fix test_neon_tx_sender.py
rozhkovdmitrii May 1, 2022
cdcca71
enable FTS
rozhkovdmitrii May 1, 2022
5366a53
revert some changes
rozhkovdmitrii May 13, 2022
c6b6935
fix one error
rozhkovdmitrii May 13, 2022
07ccac2
fix counters store
rozhkovdmitrii May 13, 2022
a3bf585
Merge branch '712-mempool' into 713-send-tx-from-mempool-worker
rozhkovdmitrii May 16, 2022
9f37b0f
Lowercase account before getting transaction count
rozhkovdmitrii May 17, 2022
bd668e1
Use delay to make tests passed
rozhkovdmitrii May 17, 2022
62d553f
Use delay to make tests passed
rozhkovdmitrii May 17, 2022
0b6686b
Rollback some changes
rozhkovdmitrii May 18, 2022
3544bd2
Rollback some changes
rozhkovdmitrii May 18, 2022
260e8f7
Spit and polish
rozhkovdmitrii May 19, 2022
8234bb8
Spit and polish
rozhkovdmitrii May 19, 2022
0a13155
Spit and polish
rozhkovdmitrii May 19, 2022
dbf5ca1
Spit and polish
rozhkovdmitrii May 19, 2022
388f028
Spit and polish
rozhkovdmitrii May 19, 2022
8e7eaf4
Spit and polish
rozhkovdmitrii May 19, 2022
93051f0
Spit and polish
rozhkovdmitrii May 19, 2022
728880a
Spit and polish
rozhkovdmitrii May 19, 2022
3d71178
Merge branch '712-mempool' into 713-send-tx-from-mempool-worker
rozhkovdmitrii May 25, 2022
92aa0f6
Renaming
rozhkovdmitrii May 31, 2022
01544a3
Merge branch '712-mempool' into 713-send-tx-from-mempool-worker
rozhkovdmitrii May 31, 2022
080b46a
Merge branch '712-mempool' into 712-mempool-renaming
rozhkovdmitrii Jun 2, 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
Rename neon_tx_exec_cfg
  • Loading branch information
rozhkovdmitrii committed Apr 21, 2022
commit 88376f80be51ac50ef931be407252fc7585caf87
2 changes: 1 addition & 1 deletion proxy/common_neon/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@dataclass
class NeonTxCfg:
class NeonTxExecCfg:
is_underpriced_tx_without_chainid: bool
steps_executed: int

Expand Down
4 changes: 2 additions & 2 deletions proxy/mempool/mempool_api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from dataclasses import dataclass

from ..common_neon.eth_proto import Trx as NeonTx
from ..common_neon.data import NeonTxCfg, NeonEmulatingResult
from ..common_neon.data import NeonTxExecCfg, NeonEmulatingResult


@dataclass
class MemPoolTxRequest:
neon_tx: NeonTx
neon_tx_cfg: NeonTxCfg
neon_tx_exec_cfg: NeonTxExecCfg
emulating_result: NeonEmulatingResult
2 changes: 1 addition & 1 deletion proxy/mempool/mempool_tx_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, config: IConfig):

def execute_neon_tx(self, mempool_tx_request: MemPoolTxRequest):
neon_tx = mempool_tx_request.neon_tx
neon_tx_cfg = mempool_tx_request.neon_tx_cfg
neon_tx_cfg = mempool_tx_request.neon_tx_exec_cfg
emulating_result = mempool_tx_request.emulating_result
emv_step_count = self._config.get_evm_count()
tx_sender = NeonTxSender(self._db, self._solana, neon_tx, steps=emv_step_count)
Expand Down
8 changes: 4 additions & 4 deletions proxy/mempool/transaction_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ..common_neon.eth_proto import Trx as EthTx
from ..common_neon.utils import NeonTxResultInfo, NeonTxInfo
from ..common_neon.errors import EthereumError
from ..common_neon.data import NeonTxCfg, NeonEmulatingResult
from ..common_neon.data import NeonTxExecCfg, NeonEmulatingResult
from ..environment import RETRY_ON_FAIL
from ..environment import HOLDER_MSG_SIZE
from ..memdb.memdb import MemDB, NeonPendingTxInfo
Expand Down Expand Up @@ -62,7 +62,7 @@ def __init__(self, db: MemDB, solana: SolanaInteractor, eth_tx: EthTx, steps: in
self._create_account_list = []
self._eth_meta_dict: Dict[str, AccountMeta] = dict()

def execute(self, exec_cfg: NeonTxCfg, emulating_result: NeonEmulatingResult) -> NeonTxResultInfo:
def execute(self, exec_cfg: NeonTxExecCfg, emulating_result: NeonEmulatingResult) -> NeonTxResultInfo:
self._validate_pend_tx()
self._prepare_execution(emulating_result)
return self._execute(exec_cfg)
Expand All @@ -83,7 +83,7 @@ def _validate_pend_tx(self):
self._pending_tx = NeonPendingTxInfo(neon_sign=self.neon_sign, operator=operator, slot=0)
self._pend_tx_into_db(self.solana.get_recent_blockslot())

def _execute(self, exec_cfg: NeonTxCfg):
def _execute(self, exec_cfg: NeonTxExecCfg):

for Strategy in [SimpleNeonTxStrategy, IterativeNeonTxStrategy, HolderNeonTxStrategy, NoChainIdNeonTxStrategy]:
try:
Expand Down Expand Up @@ -209,7 +209,7 @@ def done_account_tx_list(self, skip_create_accounts=False):
class BaseNeonTxStrategy(metaclass=abc.ABCMeta):
NAME = 'UNKNOWN STRATEGY'

def __init__(self, exec_cfg: NeonTxCfg, neon_tx_sender: NeonTxSender):
def __init__(self, exec_cfg: NeonTxExecCfg, neon_tx_sender: NeonTxSender):
self._neon_tx_exec_cfg = exec_cfg
self.is_valid = False
self.error = None
Expand Down
6 changes: 3 additions & 3 deletions proxy/neon_rpc_api_model/neon_rpc_api_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ..common_neon.keys_storage import KeyStorage
from ..common_neon.solana_interactor import SolanaInteractor
from ..common_neon.utils import SolanaBlockInfo
from ..common_neon.data import NeonTxCfg, NeonEmulatingResult
from ..common_neon.data import NeonTxExecCfg, NeonEmulatingResult
from ..common_neon.gas_price_calculator import GasPriceCalculator

from ..environment import SOLANA_URL, PP_SOLANA_URL, PYTH_MAPPING_ACCOUNT, NEON_EVM_VERSION, NEON_EVM_REVISION, \
Expand Down Expand Up @@ -452,7 +452,7 @@ def eth_sendRawTransaction(self, rawTrx: str) -> str:

self._stat_tx_success()
mempool_tx_request = MemPoolTxRequest(neon_tx=trx,
neon_tx_cfg=neon_tx_cfg,
neon_tx_exec_cfg=neon_tx_cfg,
emulating_result=emulating_result)

if not self._mempool_client.send_raw_transaction(mempool_tx_request):
Expand All @@ -471,7 +471,7 @@ def eth_sendRawTransaction(self, rawTrx: str) -> str:
self._stat_tx_failed()
raise

def precheck(self, neon_trx: EthTrx) -> Tuple[NeonTxCfg, NeonEmulatingResult]:
def precheck(self, neon_trx: EthTrx) -> Tuple[NeonTxExecCfg, NeonEmulatingResult]:
min_gas_price = self.gas_price_calculator.get_min_gas_price()
neon_validator = NeonTxValidator(self._solana, neon_trx, min_gas_price)
return neon_validator.precheck()
Expand Down
10 changes: 5 additions & 5 deletions proxy/neon_rpc_api_model/transaction_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ..environment import ACCOUNT_PERMISSION_UPDATE_INT, CHAIN_ID, NEON_GAS_LIMIT_MULTIPLIER_NO_CHAINID,\
ALLOW_UNDERPRICED_TX_WITHOUT_CHAINID

from ..common_neon.data import NeonTxCfg, NeonEmulatingResult
from ..common_neon.data import NeonTxExecCfg, NeonEmulatingResult


@logged_group("neon.Proxy")
Expand Down Expand Up @@ -58,16 +58,16 @@ def is_underpriced_tx_without_chainid(self) -> bool:
return False
return (self._tx.gasPrice < self._min_gas_price) or (self._tx.gasLimit < self._estimated_gas)

def precheck(self) -> Tuple[NeonTxCfg, NeonEmulatingResult]:
def precheck(self) -> Tuple[NeonTxExecCfg, NeonEmulatingResult]:
try:
self._prevalidate_tx()
emulating_result: NeonEmulatingResult = call_trx_emulated(self._tx)
self._prevalidate_emulator(emulating_result)

is_underpriced_tx_without_chainid = self.is_underpriced_tx_without_chainid()
neon_tx_cfg = NeonTxCfg(steps_executed=emulating_result["steps_executed"],
is_underpriced_tx_without_chainid=is_underpriced_tx_without_chainid)
return neon_tx_cfg, emulating_result
neon_tx_exec_cfg = NeonTxExecCfg(steps_executed=emulating_result["steps_executed"],
is_underpriced_tx_without_chainid=is_underpriced_tx_without_chainid)
return neon_tx_exec_cfg, emulating_result

except Exception as e:
self.extract_ethereum_error(e)
Expand Down