kwannoel / urban-octo-carnival

DRAFT REPO: trying out gitlab -> github
Apache License 2.0
1 stars 0 forks source link

Fix watch - [merged] #354

Closed kwannoel closed 3 years ago

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 9, 2021, 23:46

Merges noel/fix-watch -> master

Fixes #195, #202

cc @plotnick

Requires: https://github.com/fare/gerbil-ethereum/pull/42, since there are breaking changes to watch-contract's interface.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 9, 2021, 23:46

assigned to @kwanzknoel

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 9, 2021, 23:47

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 9, 2021, 23:47

requested review from @plotnick

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 10, 2021, 03:02

changed title from Draft: Fix {-glow-path in pass command-} to Draft: Fix {+watch+}

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 10, 2021, 04:36

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 10, 2021, 04:38

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 11, 2021, 05:01

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 14, 2021, 15:14

Following error occurs:

Assertion Error

With this trace:

*** ERROR IN clan/exception#call-with-logged-exceptions__% -- Assertion failed
0  clan/exception#call-with-logged-exceptions__% 
1  ##dynamic-env-bind                   
2  mukn/glow/runtime/participant-runtime#interpret-current-code-block 
3  mukn/glow/runtime/participant-runtime#interpret-current-code-block 
4  mukn/glow/runtime/participant-runtime#run-passive-code-block/contract 
5  mukn/glow/runtime/participant-runtime#execute-1 
6  mukn/glow/runtime/participant-runtime#execute 
7  ##dynamic-env-bind                   
8  ##dynamic-env-bind                   
9  ##dynamic-env-bind                   
10 mukn/glow/runtime/reify-contract-parameters#run 
11 ##dynamic-env-bind                   
12 ##dynamic-wind                       
13 mukn/glow/cli/interaction#start-interaction__% 
14 ##dynamic-env-bind                   
15 ##call-with-values                   
16 clan/exit#call-print-exit            
17 ##dynamic-env-bind                   
18 ##start-main                         
19 ##kernel-handlers                    
kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 14, 2021, 22:49

It is likely due to changes in glow/runtime/watch logic. Changes to gerbil-ethereum/watch have been tested.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 14, 2021, 23:01

added 2 commits

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 00:12

It works after swapping out the following line:

      ;; (def from-block first-unprocessed-block)
      (def from-block
        (if (.@ self timer-start)
        (+ (.@ self timer-start) 1)
        (.@ contract-config creation-block)))
kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 00:13

Commented on runtime/participant-runtime.ss line 217

Tests pass after swapping out this line to:

      (def from-block
        (if (.@ self timer-start)
        (+ (.@ self timer-start) 1)
        (.@ contract-config creation-block)))
kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 00:27

Commented on runtime/participant-runtime.ss line 217

timer-start is always updated to the first block number which comes in after watching.

unprocessed-block is always updated to the last block number in a watch-batch.

However, all the other unprocessed-blocks are kept in unprocessed-events slot in Runtime.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 00:29

Commented on runtime/participant-runtime.ss line 217

Another variable is initialization: timer-start is initialized to maxInitialBlock, unprocessed-block is initialized to (.@ contract-config creation-block).

UPDATE: If we initialize both to be the same, the first watch passes, and the second fails.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 00:32

Commented on runtime/participant-runtime.ss line 217

Hypothesis 1: unprocessed-block causes overlap into other participants' watch blocks. The log-data we obtain is from previous participants.

We should observe same logdata if this is the case.

UPDATE: The contract fails on second watch, with duplicate logs (need to synchronize with runtime frame, timer-start is synchronized which is why there is no problem).

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 22:03

Commented on runtime/participant-runtime.ss line 217

This is not enough however, we need to also synchronize which events we have seen, otherwise we might skip some events in previous blocks.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 15, 2021, 22:03

Commented on runtime/participant-runtime.ss line 217

See comments on watch from fare.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 18:29

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:03

Commented on runtime/participant-runtime.ss line 217

changed this line in version 5 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:03

added 10 commits

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:04

Commented on runtime/participant-runtime.ss line 99

revert, only leave typo changes.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:05

Commented on runtime/participant-runtime.ss line 105

remove comments. These are self-explanatory. Further detail can be provided in the runtime documentation #200

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:05

Commented on runtime/participant-runtime.ss line 131

revert, unprocessed-events currently not used.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:06

Commented on runtime/participant-runtime.ss line 138

We need to update this whenever we update first-unprocessed-block.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:07

Commented on runtime/participant-runtime.ss line 205

strip all DBG statements

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 21:08

Commented on runtime/participant-runtime.ss line 215

remove

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

Commented on runtime/participant-runtime.ss line 99

changed this line in version 6 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

Commented on runtime/participant-runtime.ss line 105

changed this line in version 6 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

Commented on runtime/participant-runtime.ss line 131

changed this line in version 6 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

Commented on runtime/participant-runtime.ss line 205

changed this line in version 6 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

Commented on runtime/participant-runtime.ss line 215

changed this line in version 6 of the diff

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:33

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:36

resolved all threads

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:37

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:47

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:48

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 22:49

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 16, 2021, 23:00

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:16

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:25

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:34

added 1 commit

Compare with previous version

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:36

requested review from @AlexKnauth and @fahree

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:36

marked this merge request as ready

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:38

changed the description

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 01:46

requested review from @isd

kwannoel commented 3 years ago

In GitLab by @isd on Jun 17, 2021, 05:26

Commented on runtime/participant-runtime.ss line 138

This field doesn't appear to be declared above.

kwannoel commented 3 years ago

In GitLab by @isd on Jun 17, 2021, 05:26

Commented on t/buy-sig-integrationtest.ss line 86

Would be good to have a comment here explaining what the constant is for.

kwannoel commented 3 years ago

In GitLab by @isd on Jun 17, 2021, 05:26

Commented on main.ss line 15

Explain this one to me? Why are we setting the glow path to the empty list?

kwannoel commented 3 years ago

In GitLab by @isd on Jun 17, 2021, 05:28

Looks broadly reasonable (a few comments in-line), though it seems like there's some stuff in here mostly unrelated to the fix, e.g. stuff with glow path, and the pass subcommand. It would make review easier going forward to split unrelated changes into separate prs.

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Jun 17, 2021, 20:30

Commented on t/buy-sig-integrationtest.ss line 86

changed this line in version 10 of the diff