Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
add crab
Browse files Browse the repository at this point in the history
  • Loading branch information
wuminzhe committed Dec 14, 2023
1 parent 7982cee commit 0dacec8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions Procfile.pug
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
eth: bin/rails "pug:track_logs[1]"
crab: bin/rails "pug:track_logs[44]"
arb1: bin/rails "pug:track_logs[42161]"
darwinia: bin/rails "pug:track_logs[46]"
12 changes: 7 additions & 5 deletions config/ormpscan2.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
development:
default: &default
mainnet: true
chains:
- 1
- 42161
- 46
- 44

development:
<<: *default

test:

production:
chains:
- 1
- 42161
- 46
<<: *default
6 changes: 6 additions & 0 deletions lib/tasks/messages.rake
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ def skip_message?(message_accepted_log, network)
# create message if not exists
return true if Message.find_by(from_network: network, msg_hash: message_accepted_log.decoded['msg_hash'])

# 在主网环境下,从crab链发出的,但是目标不是主网链的消息,不处理
mainnet = Rails.application.config.ormpscan2['mainnet']
chains = Rails.application.config.ormpscan2['chains'].map(&:to_i).reject { |chain_id| chain_id == 44 }
right_target_chain = chains.include?(message_accepted_log.decoded['message.to_chain_id'].to_i)
return true if mainnet && network.chain_id == 44 && !right_target_chain

false
end

Expand Down

0 comments on commit 0dacec8

Please sign in to comment.