Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Extract ethdb logic #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cryptobias
Copy link

When I tried to run the operator in Docker I ran into the problem that the dbDir directory was already created (due to it being a mounted volume), but the ethDBDir wasn't. This let to an error, because the writeEthDB method only checks for the existence of the dbDir and assumes the ehtDBDir to exist.

I also noticed the readEthDB and writeEthDB code was duplicated and already build to cope with the non-existence of the directory, so I extracted the code in to its own file and removed the unnecessary initialization in two locations.

This change will allow easier implementation of Docker support (#14), which I started working on over here: https://github.com/cryptobias/plasma-chain-operator/tree/docker-support

I unfortunately was not able to execute the tests successfully (even on master). There is no CI for this repository either, is there?

because the db and the ethDB can be configured to be in two different
places and it might even be the case that the db directory is created
but the ethDB directory within it is not
Because loadEthDB will load a default config if it is not present and
writheEthDB will create it, if it is not present. And those two methods
are the only ones accessing the directory.
@karlfloersch
Copy link
Contributor

karlfloersch commented Feb 9, 2019

There is no CI for this repository either, is there?

You are right. This should be added ASAP -- made an issue & will add myself shortly #38

I unfortunately was not able to execute the tests successfully (even on master)

What errors are you getting?

Thank you for all of this!!! Will be testing and merging all this shortly

@cryptobias
Copy link
Author

cryptobias commented Feb 9, 2019

What errors are you getting?

I seem to end up in a loop:

Server api
Operator address: 0x82A978B3f5962A5b0957d9ee9eEf472EE55B42F1
Deploying new Plasma Chain... this could take a while
Testing mode enabled so deployed a new Plasma Registry & Plasma Chain
Plasma Registry address: 0x66548B4aD6D6be74bc2DBb53ef8C4dF0f7b671B3
Plasma Chain address: 0xf38981E3aAE07AdBe024e33Ac055E26fa6583cd9
  info:state No blockNumber found! Starting from block 1. +0ms
  info:state Creating a new tx-log directory +4ms
  info:block-store Creating new block store +0ms
    /api
Operator listening on port 3000!
  info:state Attempting to acquire lock for: [ '3e7' ] +138ms
  info:state Added deposit with token type: 3e7 , start: 0 and end: a +5ms
      √ responds with status 200 on deposit (127ms)
  info:state Deposit already recorded with token type: 3e7 , start: 0 and end: a +111ms
  info:state Attempting to acquire lock for: [ '3e7' ] +3ms
  info:state Attempting to acquire lock for: [ '3e7' ] +1ms
  info:state Failed +1ms
  info:state Attempting to acquire lock for: [ '3e7' ] +1ms
  info:state Failed +1ms

The two last lines keep repeating.


Update: I did some further investigation and it seems to be happening for the responds with status 200 for many deposits test in test-api

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants