Commit Graph

36 Commits

Author SHA1 Message Date
fang
d98c59e73a
zuse: lift moves out of +able 2020-12-08 01:47:06 +01:00
fang
eab88170e2
Merge branch 'jb/motion' into m/de-thereum 2020-12-07 13:42:00 +01:00
fang
25a55c0f63
various: ethereum, azimuth, json-rpc out of zuse
Moves them into files in /lib, and updates dependents accordingly.
2020-12-06 17:26:52 +01:00
Philip Monk
b9fe6af976
jael: don't signal breach if first hearing of ship
When you first boot, if you try talk to someone before your azimuth is
up-to-date (for example by import), then if they've ever breached
(twice) then you'll get breach notification, cancelling your message.

This changes is it so that if we haven't heard anything about this ship,
we don't signal a breach.

The implementation complexity is primarily because we need
eth-watcher/azimuth-tracker to produce an update of a list instead of a
list of updates.  This way, Jael can keep a "state as of the beginning
of this move" variable to check when deciding whether to signal a
breach.
2020-12-04 23:08:47 -08:00
Philip Monk
016719ca6b
glob: added app to distribute js outside clay 2020-07-15 12:26:55 -07:00
Fang
2223a85666
eth-watcher: separate timeout from refresh-rate
Previously, when the refresh-rate timer activated, and the thread from
the previous activation was still running, we would kill it and start
a new one. For low refresh rates, on slower machines, nodes, or network
connections, this could cause the update to never conclude.

Here we add a timeout-time to eth-watcher's config. If the refresh-rate
timer activates, and a thread exists, but hasn't been running for at
least the specified timeout-time yet, we simply take no action, and wait
for the next refresh timer.

Note that we opted for "at least timeout-time", instead of killing &
restarting directly after the specified timeout-time has passed, to
avoid having to handle an extra timer flow.

In the +on-load logic, we configure the timeout-time for existing
watchdogs as six times the refresh-rate. We want to set
azimuth-tracker's timeout-time to ~m30, and don't care much about other,
less-likely-to-be-active use cases of eth-watcher.
2020-04-01 12:47:38 +02:00
Fang
55aa0cb610
apps: augment with /lib/dbug 2020-03-12 01:33:48 +01:00
Fang
ae8a57ca25
gall: (list path) in %fact and %kick
Instead of providing a (unit path), allows for (list path), which better
supports the "update to path and subpath cases".

For example, if /things wants updates about everything, and
/things/specific wants updates about the specific thing, they'll both
need to receive a %fact when the specific thing changes.
Previously, these would have been two separate moves. Now, gall handles
the multi-targeting for you.
2019-12-23 13:37:32 +01:00
Philip Monk
18c3e7253b
jael: add "eager" mode to avoid hitting nodes as much 2019-12-18 10:58:00 -03:30
Philip Monk
e5ac690fd3
jael: re-enable ship-to-ship communication
Also fix bug in eth-watcher that didn't cancel outstanding threads when
config changes.

And set default rift for ourselves to 0.
2019-12-17 16:14:07 -08:00
Philip Monk
e88f91f3b2
eth-watcher: actually stop pending thread when restarting 2019-12-17 16:14:02 -08:00
Philip Monk
fe41c31965
eth-watcher; don't start timer if already started 2019-12-03 19:13:41 -08:00
Philip Monk
0431c3c073
Merge remote-tracking branch 'origin/jam-cue-rock' into rc 2019-12-02 02:08:37 -08:00
Philip Monk
0f9ca132dd
eth-watcher: errant upgrade 2019-11-30 19:57:56 -08:00
Philip Monk
0eaad536a0
eth-watcher: keep timers going 2019-11-30 19:38:43 -08:00
Philip Monk
fbc81b59f1
eth-watcher: add state adapter to avoid breaching continuity 2019-11-30 16:14:16 -08:00
Fang
bc08e8a09f
eth-watcher: support client-specified refresh rate
Configuration now includes a refresh-rate=@dr, which is used to
determine how long to wait between polling requests.
2019-11-28 16:46:07 +01:00
Philip Monk
7cfe1542e5
ames: too big of messages 2019-11-26 12:00:27 -08:00
Philip Monk
6a406e6b29
gall: mall -> gall 2019-11-18 20:36:21 -08:00
Philip Monk
9862dccc0e
mall: age -> app 2019-11-18 19:28:59 -08:00
Fang
5c6c75c7ea
eth: move existing chain requests into ethio
To avoid reimplementing these (on top of ethio) every time. This seems
like a good place to centralize chain request logic going forward.
2019-11-04 18:59:30 +01:00
Fang
dc35958918
eth-watcher: refactor refresh rate to top of file 2019-11-04 18:57:17 +01:00
Fang
848805e007
eth: move eth-watcher's request-rpc into ethio lib
Once this is more fully featured, /app/claz could be refactored with it.
2019-10-31 15:54:56 +01:00
Fang
555eae6e25
eth-watcher: ensure logs always sent oldest-first
For easier "this happened, then that happened" on the client side.
2019-10-30 18:44:52 +01:00
Fang
e0b564f72f
eth-watcher: allow peers to unconfigured watchdogs
We simply respond with an empty history. This allows applications to
safely subscribe prior to a watchdog's creation.
2019-10-30 16:48:51 +01:00
Fang
603a3ae32b
eth-watcher: saner %watch behavior
When configuring a watchdog on a path that already exists, we now
"overwrite" it, meaning we throw away all history and trawl the node
for logs again.
If the only config change is the url, however, we silently modify it,
and simply use it "from this point onward".

This matches the behavior of the original azimuth-tracker.
2019-10-30 16:46:37 +01:00
Fang
e8d52e9b58
eth-watcher: implement %clear poke
We don't need to bother un-setting any timers or other subscriptions,
because those all happen on the app-wide level, instead of per watchdog.
2019-10-30 16:35:12 +01:00
Fang
c3ac547b3b
eth-watcher: store logs in state to implement peer
In order to give an initial response to incoming subscriptions (without
resorting to retrieving that data from chain again) we now store event
log history in state.

Instead of discarding pending-logs entirely after sending out updates,
we add them to the watchdog's history.
Just like pending-logs, we remove from the head during a rewind (though
not before exhausting the pending-logs).
2019-10-30 00:37:12 +01:00
Fang
277f2955c3
eth-watcher: move types into /sur file 2019-10-29 21:13:28 +01:00
Fang
4e9ece6cea
eth-watcher: properly tag out-peer-data 2019-10-29 19:14:21 +01:00
Fang
6437d860fe
eth-watcher: single update timer loop
Kicks the update timer on application start, then sets a new timer
whenever it's awoken. This aims to ensure eth-watcher never stops
looking for updates periodically.
2019-10-29 19:13:16 +01:00
Fang
67b4c9975e
eth-watcher: implement /block peek
/block/some-path allows you to get the next block that will be checked
for updates for the watcher at /some-path. Useful for uptime checking.
2019-10-29 19:11:36 +01:00
Fang
cda68b90b9
eth: turn azimuth-tracker into eth-watcher
Uses the logic existing in azimuth-tracker to implement a new
eth-watcher, which can look at Ethereum nodes for _any_ events, as
opposed to exclusively a subset of the Azimuth contract's events.

Azimuth-tracker will be reimplemented as a dependent of this in
forthcoming commits.
2019-10-25 19:25:31 +02:00
Fang
7bc17357ba
eth: remove old eth-watcher files
These were deprecated in favor of azimuth-tracker in #1320.

(Azimuth-tracker, however, isn't a general-purpose Ethereum log watcher
tool. Commits to transform it into a more broadly useful tool are
forthcoming.)
2019-10-25 13:08:27 +02:00
Fang
eb6c8a45ce
Replace (fall (~(get by calls with (~(gut by 2019-06-30 18:13:34 +02:00
Jared Tobin
b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00