Skip to content

Commit

Permalink
feat: add transaction propagation delays
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed May 13, 2020
1 parent 8cf7293 commit bf9651c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/models/transaction_propagation_delay.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class TransactionPropagationDelay < ApplicationRecord
end

# == Schema Information
#
# Table name: transaction_propagation_delays
#
# id :bigint not null, primary key
# tx_hash :string
# created_at_unixtimestamp :integer
# durations :jsonb
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_tx_propagation_timestamp (created_at_unixtimestamp)
#
13 changes: 13 additions & 0 deletions db/migrate/20200513032346_create_transaction_propagation_delays.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateTransactionPropagationDelays < ActiveRecord::Migration[6.0]
def change
create_table :transaction_propagation_delays do |t|
t.string :tx_hash
t.integer :created_at_unixtimestamp
t.jsonb :durations

t.timestamps
end

add_index :transaction_propagation_delays, :created_at_unixtimestamp, name: "index_tx_propagation_timestamp"
end
end
11 changes: 10 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_05_09_144539) do
ActiveRecord::Schema.define(version: 2020_05_13_032346) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -333,6 +333,15 @@
t.index ["block_number"], name: "index_mining_infos_on_block_number"
end

create_table "transaction_propagation_delays", force: :cascade do |t|
t.string "tx_hash"
t.integer "created_at_unixtimestamp"
t.jsonb "durations"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["created_at_unixtimestamp"], name: "index_tx_propagation_timestamp"
end

create_table "type_scripts", force: :cascade do |t|
t.string "args"
t.binary "code_hash"
Expand Down

0 comments on commit bf9651c

Please sign in to comment.