Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to testnet #2169

Merged
merged 50 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2090b23
Merge pull request #1817 from nervosnetwork/testnet
zmcNotafraid May 11, 2024
ab5c002
refactor: export xudt snapshot
rabbitz May 15, 2024
c6f4224
Merge pull request #1849 from rabbitz/feat/xudt_snapshot
rabbitz May 15, 2024
559e7f9
Merge pull request #1861 from nervosnetwork/testnet
zmcNotafraid May 24, 2024
3919d07
Merge pull request #1885 from nervosnetwork/testnet
rabbitz May 24, 2024
ab2ab08
Merge pull request #1889 from nervosnetwork/testnet
zmcNotafraid May 27, 2024
e6ed219
Merge pull request #1900 from nervosnetwork/testnet
zmcNotafraid May 28, 2024
34b43d9
Merge pull request #1909 from nervosnetwork/testnet
zmcNotafraid Jun 3, 2024
1944adc
Merge pull request #1915 from nervosnetwork/testnet
rabbitz Jun 5, 2024
0a0c148
Merge pull request #1921 from nervosnetwork/testnet
rabbitz Jun 5, 2024
a5ace97
Merge pull request #1933 from nervosnetwork/testnet
zmcNotafraid Jun 7, 2024
1381de1
Merge pull request #1951 from nervosnetwork/testnet
zmcNotafraid Jun 12, 2024
e68ad6f
Merge pull request #1964 from nervosnetwork/testnet
zmcNotafraid Jun 20, 2024
801feea
Merge pull request #1984 from nervosnetwork/testnet
zmcNotafraid Jun 21, 2024
8382c4a
Merge pull request #2002 from nervosnetwork/testnet
zmcNotafraid Jun 27, 2024
9e605fa
Merge pull request #2011 from nervosnetwork/testnet
rabbitz Jun 28, 2024
457e7b8
Merge pull request #2014 from nervosnetwork/testnet
rabbitz Jun 28, 2024
2b7eea8
Merge pull request #2021 from nervosnetwork/testnet
rabbitz Jul 9, 2024
417476c
Merge pull request #2050 from nervosnetwork/testnet
zmcNotafraid Jul 10, 2024
d440e8d
Merge pull request #2055 from nervosnetwork/testnet
rabbitz Jul 15, 2024
83d6a9a
Merge pull request #2066 from nervosnetwork/testnet
zmcNotafraid Jul 18, 2024
490c29a
Merge pull request #2092 from nervosnetwork/testnet
rabbitz Jul 20, 2024
86ea9a0
Merge pull request #2096 from nervosnetwork/testnet
rabbitz Jul 24, 2024
a350b2c
Merge pull request #2099 from nervosnetwork/testnet
rabbitz Jul 24, 2024
e161ec2
Merge pull request #2102 from nervosnetwork/testnet
zmcNotafraid Jul 29, 2024
4eba470
Merge pull request #2106 from nervosnetwork/testnet
rabbitz Aug 1, 2024
e94012e
Merge pull request #2112 from nervosnetwork/testnet
zmcNotafraid Aug 5, 2024
13e84b2
Merge pull request #2124 from nervosnetwork/testnet
zmcNotafraid Aug 8, 2024
ffedb62
Merge pull request #2130 from nervosnetwork/testnet
zmcNotafraid Aug 12, 2024
37ad1a0
Merge pull request #2133 from nervosnetwork/testnet
rabbitz Aug 13, 2024
09bc6fd
Merge pull request #2139 from nervosnetwork/testnet
zmcNotafraid Aug 26, 2024
6fe545a
Merge pull request #2148 from nervosnetwork/testnet
zmcNotafraid Aug 27, 2024
07a8708
hotfix: commit rack cache
zmcNotafraid Aug 27, 2024
3df06e4
Merge pull request #2151 from zmcNotafraid/hotfix-rack-cache
zmcNotafraid Aug 27, 2024
411430d
hotfix: commit script txs cache
zmcNotafraid Aug 27, 2024
1fb20e2
Merge pull request #2153 from zmcNotafraid/hotfix-script-tx
zmcNotafraid Aug 27, 2024
8e37c1a
hotfix: revert market data total_supply
zmcNotafraid Aug 27, 2024
72ce1e9
Merge pull request #2154 from zmcNotafraid/hotfix-revert-market-data
zmcNotafraid Aug 27, 2024
fe043d0
chore: use custom dalli gem
zmcNotafraid Aug 27, 2024
a5a7054
Merge pull request #2157 from zmcNotafraid/hotfix-dalli-gem
zmcNotafraid Aug 27, 2024
a5e7e47
Revert "chore: use custom dalli gem"
zmcNotafraid Aug 27, 2024
e69ae96
Revert "hotfix: revert market data total_supply"
zmcNotafraid Aug 27, 2024
7753b68
Revert "hotfix: commit script txs cache"
zmcNotafraid Aug 27, 2024
3101cd3
Revert "hotfix: commit rack cache"
zmcNotafraid Aug 27, 2024
d12319e
Merge pull request #2159 from zmcNotafraid/revert-temp-code
zmcNotafraid Aug 27, 2024
43362dd
Merge pull request #2162 from nervosnetwork/testnet
zmcNotafraid Aug 28, 2024
deeee75
Merge pull request #2166 from nervosnetwork/testnet
zmcNotafraid Aug 30, 2024
81c722a
Merge pull request #2152 from nervosnetwork/master
Keith-CY Aug 30, 2024
170f3bd
chore: fix some comments (#2136)
murongshaozong Aug 30, 2024
9150251
feat: remove cell_outputs_old table (#2170)
zmcNotafraid Sep 2, 2024
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
2 changes: 1 addition & 1 deletion app/jobs/commit_block_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def perform(block)
# reject all the other cell output that is consumed by
# transactions in current block

# collect all the previous cell outupts
# collect all the previous cell outputs
# select related cell inputs which are not in current block
# mark the transaction contains these cell input to be rejected

Expand Down
2 changes: 1 addition & 1 deletion app/models/bitcoin_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def confirmations
raw_transaction = rpc.getrawtransaction(txid, 2)
raw_transaction.dig("result", "confirmations")
rescue StandardError => e
Rails.logger.error "get #{txid} confirmations faild: #{e.message}"
Rails.logger.error "get #{txid} confirmations failed: #{e.message}"
0
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Block < ApplicationRecord
belongs_to :parent_block, class_name: "Block", foreign_key: "parent_hash", primary_key: "block_hash", optional: true,
inverse_of: :subsequent_blocks

# one block can have serveral different subsequent blocks, and only one can be included on chain
# one block can have several different subsequent blocks, and only one can be included on chain
has_many :subsequent_blocks, class_name: "Block", foreign_key: "parent_hash", primary_key: "block_hash",
inverse_of: :parent_block
belongs_to :epoch_statistic, primary_key: :epoch_number, foreign_key: :epoch, optional: true
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240902025657_drop_cell_outputs_old.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class DropCellOutputsOld < ActiveRecord::Migration[7.0]
def change
drop_table :cell_outputs_old, if_exists: true
end
end
159 changes: 2 additions & 157 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1212,56 +1212,6 @@ CREATE TABLE public.cell_outputs_live (
);


--
-- Name: cell_outputs_old; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.cell_outputs_old (
id bigint NOT NULL,
capacity numeric(64,2),
data bytea,
ckb_transaction_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
status smallint DEFAULT 0,
address_id numeric(30,0),
block_id numeric(30,0),
tx_hash bytea,
cell_index integer,
consumed_by_id numeric(30,0),
cell_type integer DEFAULT 0,
data_size integer,
occupied_capacity numeric(30,0),
block_timestamp numeric(30,0),
consumed_block_timestamp numeric(30,0),
type_hash character varying,
udt_amount numeric(40,0),
dao character varying,
lock_script_id bigint,
type_script_id bigint,
data_hash bytea
);


--
-- Name: cell_outputs_old_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.cell_outputs_old_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: cell_outputs_old_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.cell_outputs_old_id_seq OWNED BY public.cell_outputs_old.id;


--
-- Name: cell_outputs_pending; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -3059,13 +3009,6 @@ ALTER TABLE ONLY public.cell_inputs ALTER COLUMN id SET DEFAULT nextval('public.
ALTER TABLE ONLY public.cell_outputs ALTER COLUMN id SET DEFAULT nextval('public.cell_outputs_id_seq'::regclass);


--
-- Name: cell_outputs_old id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.cell_outputs_old ALTER COLUMN id SET DEFAULT nextval('public.cell_outputs_old_id_seq'::regclass);


--
-- Name: ckb_transactions id; Type: DEFAULT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -3502,14 +3445,6 @@ ALTER TABLE ONLY public.cell_outputs_live
ADD CONSTRAINT cell_outputs_live_pkey PRIMARY KEY (id, status);


--
-- Name: cell_outputs_old cell_outputs_old_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.cell_outputs_old
ADD CONSTRAINT cell_outputs_old_pkey PRIMARY KEY (id);


--
-- Name: cell_outputs_pending cell_outputs_pending_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -4702,97 +4637,6 @@ CREATE INDEX index_cell_dependencies_on_script_id ON public.cell_dependencies US
CREATE UNIQUE INDEX index_cell_inputs_on_ckb_transaction_id_and_index ON public.cell_inputs USING btree (ckb_transaction_id, index);


--
-- Name: index_cell_outputs_old_on_address_id_and_status; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_address_id_and_status ON public.cell_outputs_old USING btree (address_id, status);


--
-- Name: index_cell_outputs_old_on_block_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_block_id ON public.cell_outputs_old USING btree (block_id);


--
-- Name: index_cell_outputs_old_on_block_timestamp; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_block_timestamp ON public.cell_outputs_old USING btree (block_timestamp);


--
-- Name: index_cell_outputs_old_on_cell_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_cell_type ON public.cell_outputs_old USING btree (cell_type);


--
-- Name: index_cell_outputs_old_on_ckb_transaction_id_and_cell_index; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_cell_outputs_old_on_ckb_transaction_id_and_cell_index ON public.cell_outputs_old USING btree (ckb_transaction_id, cell_index);


--
-- Name: index_cell_outputs_old_on_consumed_block_timestamp; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_consumed_block_timestamp ON public.cell_outputs_old USING btree (consumed_block_timestamp);


--
-- Name: index_cell_outputs_old_on_consumed_by_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_consumed_by_id ON public.cell_outputs_old USING btree (consumed_by_id);


--
-- Name: index_cell_outputs_old_on_data_hash; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_data_hash ON public.cell_outputs_old USING hash (data_hash);


--
-- Name: index_cell_outputs_old_on_lock_script_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_lock_script_id ON public.cell_outputs_old USING btree (lock_script_id);


--
-- Name: index_cell_outputs_old_on_status; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_status ON public.cell_outputs_old USING btree (status);


--
-- Name: index_cell_outputs_old_on_tx_hash_and_cell_index; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_cell_outputs_old_on_tx_hash_and_cell_index ON public.cell_outputs_old USING btree (tx_hash, cell_index);


--
-- Name: index_cell_outputs_old_on_type_script_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_type_script_id ON public.cell_outputs_old USING btree (type_script_id);


--
-- Name: index_cell_outputs_old_on_type_script_id_and_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_cell_outputs_old_on_type_script_id_and_id ON public.cell_outputs_old USING btree (type_script_id, id);


--
-- Name: index_contracts_on_code_hash; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -6097,6 +5941,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20240709131132'),
('20240709131713'),
('20240709142013'),
('20240822024448');
('20240822024448'),
('20240902025657');


2 changes: 1 addition & 1 deletion test/utils/ckb_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class CkbUtilsTest < ActiveSupport::TestCase
end
end

test ".parse_dao should return nil whne dao is blank" do
test ".parse_dao should return nil when dao is blank" do
assert_nil CkbUtils.parse_dao(nil)
end

Expand Down
Loading