0x-mesh icon indicating copy to clipboard operation
0x-mesh copied to clipboard

Use a separate database URL/path for each Ethereum network

Open albrow opened this issue 4 years ago • 1 comments

Historically, we have seen issues whenever there is a mismatch between the chainId/network used in the database and the chainId/network for the Ethereum RPC URL. We have some code in place to help identify mismatches but that code isn't perfect. There is a race condition on startup where some data from the wrong chain can still make its way into the database. We also are not able to handle switching the chainId/network on the fly in the browser.

As an alternative and cleaner solution, I suggest we keep the data for each chainId/network separate by using a different database URL or path for each one. This is the approach that Augur and a few others have taken.

albrow avatar Jul 17 '20 20:07 albrow

@albrow Thanks for clarifying. I agree that using a separate database URL (and database I suppose) for each network, sounds quite a bit better than the current solution.

jalextowle avatar Jul 17 '20 20:07 jalextowle