Skip to content

Commit

Permalink
added security feature to epmd so we don't listen to outside contact.…
Browse files Browse the repository at this point in the history
… add function to oracles.erl to know which oracles are ready to be closed. update documentation about closing markets.
  • Loading branch information
zack-bitcoin committed Aug 30, 2018
1 parent 132cf10 commit 6c392fc
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -11,6 +11,9 @@ SWAGGER = apps/amoveo_http/src/swagger
SWTEMP := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
LOCAL = ./_build/local/rel

export ERL_EPMD_ADDRESS=127.0.0.1


kill:
@echo "Kill all beam processes only from this directory tree"
$(shell pkill -9 -f ".*/beam.*-boot `pwd`" || true)
Expand Down
16 changes: 15 additions & 1 deletion apps/amoveo_core/src/consensus/trees/oracles.erl
Expand Up @@ -3,7 +3,7 @@
write/2, get/2,%update tree stuff
dict_get/2, dict_write/2, dict_write/3, %update dict stuff
meta_get/1, deserialize/1, all/0,
ready_for_bets/0,
ready_for_bets/0, ready_to_close/0,
verify_proof/4,make_leaf/3,key_to_int/1,serialize/1,test/0]). %common tree stuff
-define(name, oracles).
-include("../../records.hrl").
Expand Down Expand Up @@ -43,6 +43,20 @@ all() ->
end,
{Text, X}
end, All).
ready_to_close() ->
A = all(),
rtc2(A).
rtc2([]) -> [];
rtc2([{Text, Oracle}|T]) ->
R = Oracle#oracle.result,
D = Oracle#oracle.done_timer,
H = block:height(),
if
(H < D) -> rfb2(T);
(not (R == 0)) -> rfb2(T);
true -> [{Text, Oracle}|rfb2(T)]
end.

ready_for_bets() ->
A = all(),
rfb2(A).
Expand Down
2 changes: 2 additions & 0 deletions config/vm.args
@@ -1,6 +1,8 @@
-sname amoveo_core

-setcookie amoveo_core_cookie
-kernel inet_dist_use_interface {127,0,0,1}


+K true
+A30
13 changes: 12 additions & 1 deletion docs/api/commands_market.md
@@ -1,8 +1,19 @@





```
api:new_market(OID, Expires, Period).
```

period is how many blocks you have to wait till bets get matched in a batch.
Expires is the height at which betting stops.
Expires is the height at which betting stops.



```
order_book:dump(OID).
```
This is how you remove a market once it is closed.
WARNING: make sure all the channels have closed their positions before closing the market.
12 changes: 12 additions & 0 deletions docs/research_suggestions/secure_light_node_download.md
@@ -0,0 +1,12 @@
The problem is how to securely download a copy of the light node software so that you can trust that the Merkel proofs are valid.

potential solution-

The full node uses it's pubkey in the url, and it signs the light node software it sends to you.
If the signature is invalid for the pubkey in the url, then you don't use it.

The hub doesn't know if you are syncing fresh, or if you already have a copy of the light node software.

The hub makes a fraud proof, so it will lose a ton of money to anyone who can show it signed a bad copy of the light node software.

Many people would be constantly testing hubs, because if the hub lies, they can take all the hub's money.
6 changes: 6 additions & 0 deletions docs/todo.md
Expand Up @@ -10,6 +10,12 @@ Maybe we should add a governance variables for each opcode in the VM. To be a ga

version in spend txs is not being used.

add n-lock-time to spend txs, that way we can make dead man's switches for inheritance.

maybe channel_team_close_tx should have a negative fee. As a reward for deleting the channel.
We could raise the fee for opening channels, and the reward for closing them.
This would prevent attacks where the attacker opens too many channels, and tries to close them all in too short of a time period.


### governance ideas

Expand Down

0 comments on commit 6c392fc

Please sign in to comment.