From 556acc0b702c299623034d5e0c969ced79027684 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:08:20 +0900 Subject: [PATCH 1/5] chore(deps): bump actionpack from 7.0.8.4 to 7.0.8.5 (#2243) Bumps [actionpack](https://github.com/rails/rails) from 7.0.8.4 to 7.0.8.5. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.2.1.1/actionpack/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.8.4...v7.0.8.5) --- updated-dependencies: - dependency-name: actionpack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 124 +++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 039ca9acd..593c30cd1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,47 +10,47 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) + actioncable (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionmailbox (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.4) - actionpack (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionmailer (7.0.8.5) + actionpack (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.8.4) - actionview (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionpack (7.0.8.5) + actionview (= 7.0.8.5) + activesupport (= 7.0.8.5) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.4) - actionpack (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + actiontext (7.0.8.5) + actionpack (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.4) - activesupport (= 7.0.8.4) + actionview (7.0.8.5) + activesupport (= 7.0.8.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -58,24 +58,24 @@ GEM active_interaction (5.3.0) activemodel (>= 5.2, < 8) activesupport (>= 5.2, < 8) - activejob (7.0.8.4) - activesupport (= 7.0.8.4) + activejob (7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.3.6) - activemodel (7.0.8.4) - activesupport (= 7.0.8.4) - activerecord (7.0.8.4) - activemodel (= 7.0.8.4) - activesupport (= 7.0.8.4) + activemodel (7.0.8.5) + activesupport (= 7.0.8.5) + activerecord (7.0.8.5) + activemodel (= 7.0.8.5) + activesupport (= 7.0.8.5) activerecord-import (1.4.1) activerecord (>= 4.2) - activestorage (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activesupport (= 7.0.8.4) + activestorage (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activesupport (= 7.0.8.5) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.8.4) + activesupport (7.0.8.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -135,7 +135,7 @@ GEM thor bootsnap (1.13.0) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) coderay (1.1.3) concurrent-ruby (1.3.4) @@ -202,7 +202,7 @@ GEM ecdsa (1.2.0) ecdsa_ext (0.5.1) ecdsa (~> 1.2.0) - erubi (1.12.0) + erubi (1.13.0) et-orbi (1.2.11) tzinfo eventmachine (1.2.7) @@ -241,7 +241,7 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) iniparse (1.5.0) io-event (1.1.6) @@ -285,7 +285,7 @@ GEM method_source (1.1.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.23.1) + minitest (5.25.1) minitest-reporters (1.6.1) ansi builder @@ -308,12 +308,12 @@ GEM net-protocol newrelic_rpm (8.12.0) nio4r (2.7.3) - nokogiri (1.16.5) + nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) pagy (5.10.1) activesupport @@ -347,8 +347,8 @@ GEM puma (6.4.3) nio4r (~> 2.0) raabro (1.4.0) - racc (1.8.0) - rack (2.2.9) + racc (1.8.1) + rack (2.2.10) rack-attack (6.6.1) rack (>= 1.0, < 3) rack-cache (1.13.0) @@ -357,20 +357,20 @@ GEM rack (>= 2.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.4) - actioncable (= 7.0.8.4) - actionmailbox (= 7.0.8.4) - actionmailer (= 7.0.8.4) - actionpack (= 7.0.8.4) - actiontext (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activemodel (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + rails (7.0.8.5) + actioncable (= 7.0.8.5) + actionmailbox (= 7.0.8.5) + actionmailer (= 7.0.8.5) + actionpack (= 7.0.8.5) + actiontext (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activemodel (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) bundler (>= 1.15.0) - railties (= 7.0.8.4) + railties (= 7.0.8.5) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -378,9 +378,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) + railties (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) method_source rake (>= 12.2) thor (~> 1.0) From c9f7e5111165b548843376a3396f577f26230986 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:09:03 +0900 Subject: [PATCH 2/5] chore(deps): bump actionmailer from 7.0.8.4 to 7.0.8.5 (#2242) Bumps [actionmailer](https://github.com/rails/rails) from 7.0.8.4 to 7.0.8.5. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.2.1.1/actionmailer/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.8.4...v7.0.8.5) --- updated-dependencies: - dependency-name: actionmailer dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From ac27d12841230a20c6786d9f979ad786b6a14e6a Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Thu, 17 Oct 2024 22:11:30 +0900 Subject: [PATCH 3/5] fix: run worker async in scheduler (#2248) Signed-off-by: Miles Zhang --- lib/scheduler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scheduler.rb b/lib/scheduler.rb index dec18da08..a465c1359 100644 --- a/lib/scheduler.rb +++ b/lib/scheduler.rb @@ -26,7 +26,7 @@ def call_worker(clz) clz = clz.constantize if clz.is_a?(String) puts "invoking #{clz.name}" - clz.new.perform + clz.new.perform_async puts "fininsh #{clz.name}" end From 174ae55700ea942728e7ac3012ac680b1a75b998 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Thu, 17 Oct 2024 22:11:46 +0900 Subject: [PATCH 4/5] feat: bind lock_script and address in pending tx (#2247) Signed-off-by: Miles Zhang --- app/models/ckb_sync/transactions.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/ckb_sync/transactions.rb b/app/models/ckb_sync/transactions.rb index ef0360b01..9f2ca8d7d 100644 --- a/app/models/ckb_sync/transactions.rb +++ b/app/models/ckb_sync/transactions.rb @@ -50,7 +50,11 @@ def import tx_mappings = tx_returnings.rows.to_h { |id, tx_hash| [tx_hash.sub(/^\\x/, "0x"), id] } lock_script_returnings = LockScript.upsert_all(lock_script_attrs.to_a, unique_by: :script_hash, returning: %i[id script_hash]) lock_script_mappings = lock_script_returnings.rows.to_h { |id, script_hash| [script_hash, id] } - address_returnings = Address.upsert_all(addresses_attrs.to_a, unique_by: :lock_hash, returning: %i[id lock_hash]) + new_addresses_attrs = + addresses_attrs.to_a.map do |attr| + attr.merge({ lock_script_id: lock_script_mappings[attr[:lock_hash]] }) + end + address_returnings = Address.upsert_all(new_addresses_attrs, unique_by: :lock_hash, returning: %i[id lock_hash]) address_mappings = address_returnings.rows.to_h { |id, lock_hash| [[lock_hash.sub(/^\\x/, "")].pack("H*"), id] } type_script_mappings = {} if type_script_attrs.present? From 4c7f0753314cba93685884d977157b4befa10b7c Mon Sep 17 00:00:00 2001 From: Rabbit Date: Thu, 17 Oct 2024 21:13:06 +0800 Subject: [PATCH 5/5] fix: update udt info (#2249) --- app/workers/update_udt_info_worker.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/workers/update_udt_info_worker.rb b/app/workers/update_udt_info_worker.rb index 60a4b9038..0b92e4402 100644 --- a/app/workers/update_udt_info_worker.rb +++ b/app/workers/update_udt_info_worker.rb @@ -7,13 +7,8 @@ def perform(block_number) return if local_block.blank? type_hashes = [] - local_block.cell_outputs.udt.select(:id, :type_hash).each do |udt_output| - type_hashes << udt_output.type_hash - end - local_block.cell_outputs.omiga_inscription.select(:id, :type_hash).each do |udt_output| - type_hashes << udt_output.type_hash - end - local_block.cell_outputs.xudt.select(:id, :type_hash).each do |udt_output| + local_block.cell_outputs.where(cell_type: ["udt", "omiga_inscription", "xudt", "xudt_compatible"]). + select(:id, :type_hash).each do |udt_output| type_hashes << udt_output.type_hash end local_block.ckb_transactions.pluck(:id).each do |tx_id|