Skip to content

Commit

Permalink
Set limit for select from mempool
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <[email protected]>
  • Loading branch information
Deniallugo committed Mar 24, 2023
1 parent 6a62cd2 commit c7abae9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 64 deletions.
124 changes: 62 additions & 62 deletions core/lib/storage/sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,68 @@
},
"query": "\n INSERT INTO incomplete_blocks (number, fee_account_id, unprocessed_prior_op_before, unprocessed_prior_op_after, block_size, commit_gas_limit, verify_gas_limit, timestamp)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n "
},
"317d9425b02522272d2f3385e5f5e10c30492a1b21431db58db822b8dd6dbc47": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
},
{
"name": "tx_hash",
"ordinal": 1,
"type_info": "Text"
},
{
"name": "tx",
"ordinal": 2,
"type_info": "Jsonb"
},
{
"name": "created_at",
"ordinal": 3,
"type_info": "Timestamptz"
},
{
"name": "eth_sign_data",
"ordinal": 4,
"type_info": "Jsonb"
},
{
"name": "batch_id",
"ordinal": 5,
"type_info": "Int8"
},
{
"name": "next_priority_op_serial_id",
"ordinal": 6,
"type_info": "Int8"
},
{
"name": "reverted",
"ordinal": 7,
"type_info": "Bool"
}
],
"nullable": [
false,
false,
false,
false,
true,
false,
true,
false
],
"parameters": {
"Left": [
"TextArray"
]
}
},
"query": "SELECT * FROM mempool_txs WHERE reverted = false AND tx_hash NOT IN (\n SELECT u.hashes FROM UNNEST ($1::text[]) as u(hashes)\n )\n ORDER BY id\n LIMIT 400\n "
},
"3186e2d96b7f1e1339ac9f09221ae15aba8dff112083079fc6ef5f3acbfc1553": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -4614,68 +4676,6 @@
},
"query": "UPDATE prover_job_queue SET last_block = $1 WHERE last_block > $1"
},
"86ae541a53bd5bf92292c220de97a1940aa45aac2b759965b389308de0b36eb6": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
},
{
"name": "tx_hash",
"ordinal": 1,
"type_info": "Text"
},
{
"name": "tx",
"ordinal": 2,
"type_info": "Jsonb"
},
{
"name": "created_at",
"ordinal": 3,
"type_info": "Timestamptz"
},
{
"name": "eth_sign_data",
"ordinal": 4,
"type_info": "Jsonb"
},
{
"name": "batch_id",
"ordinal": 5,
"type_info": "Int8"
},
{
"name": "next_priority_op_serial_id",
"ordinal": 6,
"type_info": "Int8"
},
{
"name": "reverted",
"ordinal": 7,
"type_info": "Bool"
}
],
"nullable": [
false,
false,
false,
false,
true,
false,
true,
false
],
"parameters": {
"Left": [
"TextArray"
]
}
},
"query": "SELECT * FROM mempool_txs WHERE reverted = false AND tx_hash NOT IN (\n SELECT u.hashes FROM UNNEST ($1::text[]) as u(hashes)\n )\n\n ORDER BY id"
},
"88106cb99f8c4fa89245f5d4ad5798ced4a32a9005759ca9351e42e44f4d437d": {
"describe": {
"columns": [
Expand Down
5 changes: 3 additions & 2 deletions core/lib/storage/src/chain/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ impl<'a, 'c> MempoolSchema<'a, 'c> {
"SELECT * FROM mempool_txs WHERE reverted = false AND tx_hash NOT IN (
SELECT u.hashes FROM UNNEST ($1::text[]) as u(hashes)
)
ORDER BY id",
ORDER BY id
LIMIT 400
",
&excluded_txs
)
.fetch_all(self.0.conn())
Expand Down

0 comments on commit c7abae9

Please sign in to comment.