Skip to content

Commit

Permalink
release (#305)
Browse files Browse the repository at this point in the history
* Fabo/fix gas (#250)

* fix gas estimate

* linted

* fixed test

* do not keep data sources (#251)

* track failing transactions in Sentry (#249)

* correctly set the tx schema for a failing tx (#248)

* Fabo/remove per block caching as not working (#247)

* remove per block caching as not working

* fix memoized results

Co-authored-by: Ana G. <[email protected]>

* delete perblockcachedatasource (#253)

* Ana/fix balances in actionmodal (#255)

* fix action modal available balance

* include regen

* use dictionary for denomlookup

* use correct events for received txs (#257)

* enable account creation for some networks (#252)

* network update time metric added (#256)

* network update time metric added

* added missing dep

Co-authored-by: Fabian <[email protected]>

* Fix proposal deposit (#261)

* Remove denom handling from getDeposit()

* Revert undesired change

* delete package-lock.json

* localtestnet config change (#265)

* Ana/handle "address not from this network" error (#263)

* add check address function for all queries

* apply suggestions

* Ana/add fiatvalue to balances query (e-Money) (#262)

* preparation

* more preparation

* add fiatvalue field to balances query

* fix get account info

* apply suggestions

* apply one last suggestion

* suggestions+

Co-authored-by: Fabian <[email protected]>

* Ana/emoney fix expected returns with inflation and totalbacked (#243)

* fix expected returns with inflation and supply

* minor fixes. dictionary

* query exchange rates from emoney api

* fix infinite expected returns

* convert api url to const

* add eur value to totalbackedvalue. totalngm gains

* add important comment

* finish calculation

* lint

* catch errors with sentry

Co-authored-by: Fabian <[email protected]>

* readd coin conversion (#268)

* delete amount field (#274)

* Fabo/increase gas again (#271)

* icrease gas again

* fixed test

* Fabo/load all txs (even if more then first page in response) (#270)

* load all txs (even if more then first page in response)

* improved handling of txs

* missing renaming

* fixed paginated load

* add pagination fix also to cosmosV0-source

Co-authored-by: iambeone <[email protected]>
Co-authored-by: Ana G. <[email protected]>

* fixing issue with multiple senders in one event (#273)

* fixing issue with multiple senders in one event

* Update lib/source/cosmosV2-source.js

Co-authored-by: Fabian <[email protected]>

* Fabo/allow signing for terra + emoney (#267)

* allow signing for terra

* readd coin conversion

* enable actions for terra

* fix correct terra testnet url

* comments and guards

* enabled more txs for emoney and fixed broadcasting

* added a catch for wrongly formatted broadcast urls

* recover default field. change some network titles (#277)

* Fabo/add network data to API (#278)

* non desctructive introduction of better address prefix wording

* added address creator to API

* adjusted test

* added ledger app to networks config

* add icon property to schema (#281)

* add icon property to schema

* fix network schema validation

Co-authored-by: Ana G. <[email protected]>

* filter out validator specific txs (#279)

* Ana/balances coinreducer good fix (#269)

* balances coinreducer good fix

* refactored fiat value logic

Co-authored-by: Fabian <[email protected]>

* Create network_integration.md

* Update network_integration.md

* Update network_integration.md

* Fabo/avoid 500 errors (#288)

* avoid using the latest query

* cleanup

* Ana/filter validator tx cross network and add txvalue reducer (#285)

* filter validators cross network

* add value reducer. necessary for multi claim txs

* add validator txs filter also for cosmosv0 source

* filter and make array only claim rewards msg value

* filter txs by whitelist

* change length in multi claim reward reducer

* add withdrawvalidators

* replace dictionary for set

* refactor transaction snippet. avoid repetition

* Ana/emoney upgrade (mergeable) (#282)

* update emoney api_url

* fix denom. add default fiat currency

* fix rpc endpoint

* fix value (my bad) (#293)

* fix value (my bad)

* trigger another ci flow

* erase space

* set correct new chain id (#294)

* restart API

* restart API

* fix pr alert (#297)

* Fabo/298 tendermint reconnect (#300)

* reconnect on tendermint disconnect

* cleanup

* comments

* Update cosmos-node-subscription.js

* Fabo/299 trigger a chain hangup error (#301)

* trigger a chain hangup error

* increase chain hangup time

* Apply suggestions from code review

Co-authored-by: Ana G. <[email protected]>
Co-authored-by: Aleksey Rudometov <[email protected]>
Co-authored-by: Mario Pino <[email protected]>
Co-authored-by: Jordan Bibla <[email protected]>
  • Loading branch information
5 people authored Feb 10, 2020
1 parent 97d7535 commit d2e06a5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
name: AlertOnPR

on:
on:
pull_request:
types: [opened]
jobs:
test:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'pr_alerts'
SLACK_USERNAME: 'luniebot'
SLACK_ICON: 'https://emoji.slack-edge.com/TH6F97TDF/lunie/4ac63c1d435c04dc.png'
SLACK_MESSAGE: ${{ github.event.pull_request.title }} | ${{ github.event.pull_request.body }} | ${{ github.event.pull_request._links.html.href }}
- name: curl message
run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "
{
\"channel\": \"#pr_alerts\",
\"username\": \"pr_alert\",
\"icon_url\": \"https://emoji.slack-edge.com/TH6F97TDF/lunie/4ac63c1d435c04dc.png\",
\"attachments\": [
{
\"fallback\": \"Required plain-text summary of the attachment.\",
\"color\": \"#36a64f\",
\"author_name\": \"${{github.event.pull_request.user.login}}\",
\"author_link\": \"${{github.event.pull_request.user.url}}\",
\"author_icon\": \"${{github.event.pull_request.user.avatar_url}}\",
\"title\": \"${{github.event.pull_request.title}}\",
\"title_link\": \"${{github.event.pull_request.html_url}}\",
\"text\": \"${{github.event.pull_request.body}}\",
\"fields\": [
{
\"title\": \"Repo\",
\"value\": \"${{github.event.repository.full_name}}\",
\"short\": false
}
]
}
]
}"
41 changes: 37 additions & 4 deletions lib/block-listeners/cosmos-node-subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
const Sentry = require('@sentry/node')

const WAIT_FOR_BLOCK_DELAY = 5000
const EXPECTED_MAX_BLOCK_WINDOW = 120000

// This class establishes an rpc connection to Tendermint.
// Used for listening to events, such as new blocks.
Expand All @@ -21,33 +22,65 @@ class CosmosNodeSubscription {
this.metric = io.metric({
name: `${this.network.id}_update`
})
this.chainHangup = undefined

this.connectTendermint(this.network)
}

async connectTendermint(network) {
console.log('Connecting to Tendermint on', network.rpc_url)
// Create a RPC subscription for each network that will react to new block events.
Tendermint()
.connect(this.network.rpc_url)
.connect(network.rpc_url)
.then(connectedClient => {
console.log('Connected to Tendermint on', network.rpc_url)
connectedClient.subscribe({ query: "tm.event='NewBlock'" }, event => {
// this tracks the block times
// issue: this will only trigger if there are actually blocks I guess
if (this.lastupdate) {
const diff = Date.now() - this.lastupdate
this.metric.set(diff)
}
this.lastupdate = Date.now()

setTimeout(
() => this.newBlockHandler(event.block.header.height),
WAIT_FOR_BLOCK_DELAY
)

// if there are no new blocks for some time, trigger an error
// TODO: show this error automatically in the UI
if (this.chainHangup) clearTimeout(this.chainHangup)
this.chainHangup = setTimeout(() => {
console.error(`Chain ${this.network.id} seems to have halted.`)
Sentry.captureException(
new Error(`Chain ${this.network.id} seems to have halted.`)
)
}, EXPECTED_MAX_BLOCK_WINDOW)
})

// on connection lost, reconnect to tendermint + Sentry error
connectedClient.ondisconnect = () => {
console.log('Lost connection to Tendermint for', network.rpc_url)

Sentry.withScope(function(scope) {
scope.setExtra('network', network.id)
scope.setExtra('rpc_url', network.rpc_url)
Sentry.captureException(new Error(`Lost Tendermint connection`))
})
setTimeout(() => this.connectTendermint(network), 3000)
}
})
.catch(e => {
Sentry.withScope(function(scope) {
scope.setExtra('network', network.id)
scope.setExtra('rpc_url', network.rpc_url)
Sentry.captureException(e)
})
})

// disabled immediate validator query as, as the `latest` query is buggy
// this.newBlockHandler()
// if can't connect, retry
setTimeout(() => this.connectTendermint(network), 3000)
})
}

// For each block event, we fetch the block information and publish a message.
Expand Down

0 comments on commit d2e06a5

Please sign in to comment.