Giter Club home page Giter Club logo

go-ten's People

Contributors

0xjba avatar anixon604 avatar badgersrus avatar bedrocksquirrel avatar caismanai avatar gavt avatar jamescarlyle avatar jennievon avatar jxilt avatar moraygrieve avatar otherview avatar revelationxl avatar shuoer86 avatar sqltrigger avatar stefaniliev545 avatar tudor-malene avatar yahiamarzouk avatar zkokelj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-ten's Issues

Some nodes do not store rollup headers in host DB

I modified func (db *DB) AddRollupHeader(header *common.Header, txHashes []gethcommon.Hash) { to add some logging to check whether a rollup's transactions were being stored:

func (db *DB) AddRollupHeader(shortId uint64, header *common.Header, txHashes []gethcommon.Hash) {
	b := db.kvStore.NewBatch()
	writeRollupHeader(b, header)
	writeRollupHash(b, header)
	for _, txHash := range txHashes {
		log.Info("node %d writing tx %s under number %d", shortId, txHash, header.Number)
		writeRollupNumber(b, txHash, header)
}
...

You can see in the attached logs that for some transactions, one of the nodes does not store them.

For example, if you search the logs for the line "writing tx 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd under number", you'll see that node 0 does not store this transaction.

Weirdly, node 0 does store other transactions for that rollup, just not that specific one. See the following log lines - node 0 only stores a single transaction for that rollup, where the other nodes store three.

Aug  2 19:59:32.024 INF node 0 writing tx 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a under number 10
Aug  2 19:59:32.026 INF node 2 writing tx 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd under number 10
Aug  2 19:59:32.026 INF node 2 writing tx 0x7f9af304ba35a4c517eb531213483d6736577197608af937375dea27f6b00d7a under number 10
Aug  2 19:59:32.026 INF node 2 writing tx 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a under number 10
Aug  2 19:59:32.027 INF node 4 writing tx 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd under number 10
Aug  2 19:59:32.027 INF node 4 writing tx 0x7f9af304ba35a4c517eb531213483d6736577197608af937375dea27f6b00d7a under number 10
Aug  2 19:59:32.027 INF node 4 writing tx 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a under number 10
Aug  2 19:59:32.027 INF node 3 writing tx 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd under number 10
Aug  2 19:59:32.027 INF node 3 writing tx 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a under number 10
Aug  2 19:59:32.027 INF node 3 writing tx 0x7f9af304ba35a4c517eb531213483d6736577197608af937375dea27f6b00d7a under number 10
Aug  2 19:59:32.027 INF node 1 writing tx 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd under number 10
Aug  2 19:59:32.028 INF node 1 writing tx 0x7f9af304ba35a4c517eb531213483d6736577197608af937375dea27f6b00d7a under number 10
Aug  2 19:59:32.028 INF node 1 writing tx 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a under number 10

We can also see from the logs that the rollup appears to be published and win twice - once by node 0 with only a single transaction, and once by node 4 with many transactions:

Aug  2 19:59:31.354 INF >   Agg0: Publish rollup=r_1985238746473799162(10)[r_3446013531048649987]{proof=b_9857441080405350445(33)}. Num Txs: 1. Txs: [0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a,].  Root=0x2b1431b71eef3c861f0f5371f83a7ccbf6bbf629f7ed0612a2235d69ba12dc24. 
Aug  2 19:59:31.354 INF >   Agg0: Winner (b_9857441080405350445) r_1985238746473799162(10).
Aug  2 19:59:31.360 INF >   Agg4: Publish rollup=r_8376691643348898319(10)[r_3446013531048649987]{proof=b_9857441080405350445(33)}. Num Txs: 4. Txs: [0xe5c440ba47df76463c9172617d263fee7225dbb7c4b9f2ab33174e458b1a4d04, 0xf5aa419a62c27c54c4a4323df41e7387d60508e3d44e5b50da3f9194b2770edd, 0x7f9af304ba35a4c517eb531213483d6736577197608af937375dea27f6b00d7a, 0x38e1408bb7e3a37dd9b7a0b52c8ab8120117b73cf6d12e93cc200b2c33ff214a,].  Root=0x611e654e5e5f83b30a89a7e2a15ead03068d4aaae302de5e53d9da28b059fd38. 
Aug  2 19:59:31.360 INF >   Agg4: Winner (b_9857441080405350445) r_8376691643348898319(10).

These logs were produced by running the full network sim.

sim-log-2022-08-02_19-58-54-full-network-1930208033.txt

Wallet Extension doesn't support external private key wallets.

I'd appreciate help. I'm using ethers.js, creating a signer using a specified private key (which belongs to an account used to deploy an ERC20 contract), registering that address with the Wallet Extension, and then sending a transfer() transaction via the WE. I'm expecting the transfer() to succeed, since the ERC20 owner has a substantial balance.

Here's a minimal set of code to reproduce the issue:

import ethers from 'ethers';
import fetch from 'node-fetch';

const USER_ADDRESS = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8';
const OBSCURO_HTTP_ENDPOINT = 'http://127.0.0.1:3000';
const PATH_GENERATE_VK = '/generateviewingkey/';
const PATH_SUBMIT_VK = '/submitviewingkey/';
const JSON_HEADERS = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
const ERC20_ADDRESS = '0x9802F661d17c65527D7ABB59DAAD5439cb125a67';
const ERC20_PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';
const rpcProvider = new ethers.providers.JsonRpcProvider(OBSCURO_HTTP_ENDPOINT);
const erc20Issuer = new ethers.Wallet(ERC20_PRIVATE_KEY, rpcProvider);
const ERC20_ISSUER_ADDRESS = erc20Issuer.address;
const ERC20_ABI = [
    {
        "inputs": [
            { "internalType": "address", "name": "receiver", "type": "address" },
            { "internalType": "uint256", "name": "numTokens", "type": "uint256" }
        ],
        "name": "transfer",
        "outputs": [
            { "internalType": "bool", "name": "", "type": "bool" }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    }
];
const erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, rpcProvider);

(async () => {
    const generateViewingKeyResp = await fetch(
        OBSCURO_HTTP_ENDPOINT + PATH_GENERATE_VK, {
        method: 'POST',
        headers: JSON_HEADERS,
        body: JSON.stringify({ 'address': ERC20_ISSUER_ADDRESS })
    }
    );
    if (!generateViewingKeyResp.ok) {
        alert('Failed to generate viewing key for Issuer.' + generateViewingKeyResp);
        return;
    };
    const viewingKey = await generateViewingKeyResp.text();
    console.log(viewingKey);

    const signature = await erc20Issuer.signMessage(JSON.stringify(['vk' + viewingKey, erc20Issuer.address]));
    const signedViewingKeyJson = { "signature": signature, "address": erc20Issuer.address }
    const submitViewingKeyResp = await fetch(
        OBSCURO_HTTP_ENDPOINT + PATH_SUBMIT_VK, {
        method: 'POST',
        headers: JSON_HEADERS,
        body: JSON.stringify(signedViewingKeyJson)
    }
    );
    if (!submitViewingKeyResp.ok) {
        console.log('Failed to submit viewing key for Issuer.' + submitViewingKeyResp.statusText);
        return;
    };

    const tx = await erc20.populateTransaction.transfer(
        USER_ADDRESS,
        ethers.utils.parseUnits('1.0', 18),
        { gasLimit: 400000 }
    );
    const sentTx = await erc20Issuer.sendTransaction(tx);
    const receipt = await sentTx.wait();
    alert('Request accepted. Your receipt is: ' + JSON.stringify(receipt));


})().catch(err => {
    console.error(err);
});```

During simulation, L1 node occasionally have a height greater than the putative max height

In the simulation, we perform the following check:

// check that the L1 view is consistent with the L1 network.
if maxEthereumHeight-l1Height > MAX_BLOCK_DELAY {
	t.Errorf("Obscuro node %d fell behind %d blocks.", obscurocommon.ShortAddress(node.ID), maxEthereumHeight-l1Height)
}

However, sometimes l1Height is actually greater than maxEthereumHeight. We should investigate why this happens.

One possibility is that the sim keeps creating blocks while the checking is ongoing, and too many are created between when maxEthereumHeight is originally calculated and when the check is performed.

Update ObscuroScan front end

ObscuroScan needs to have two viewing modes:

  1. Personal - for when users are connected through a wallet extension and capable of viewing their private details
  2. Public - for anyone viewing the website

Personal stories:

  • Add a panel displaying personal transaction history
  • Add a pop up window/pane that displays advanced transaction information taken from the receipt

Out-of-memory bug on enclave after 2 hours (with blocks 1 per sec, rollups 1 per 2 secs)

After running a network of 2x Geth nodes, 2x hosts, 2x enclave services in Azure for c. 2 hours, with one block per second and a rollup every two seconds, the enclave service failed with the OOM below.

To fix this, we need to store stuff to disk which is currently stored in memory.

1653055994565 INFO: >   Agg2: Round winner height: 4154
runtime: out of memory: cannot allocate 4194304-byte block (66486272 in use)
fatal error: out of memory

goroutine 24867 [running]:
runtime.throw({0x7fc041d4bce9?, 0x0?})
	/opt/ego/go/src/runtime/panic.go:992 +0x71 fp=0x7fc0580f7280 sp=0x7fc0580f7250 pc=0x7fc041685eb1
runtime.(*mcache).allocLarge(0x7fc058398d00?, 0x178608, 0x0)
	/opt/ego/go/src/runtime/mcache.go:215 +0x1d9 fp=0x7fc0580f72d0 sp=0x7fc0580f7280 pc=0x7fc0416676b9
runtime.mallocgc(0x178608, 0x7fc041f182e0, 0x1)
	/opt/ego/go/src/runtime/malloc.go:1101 +0x5a5 fp=0x7fc0580f7348 sp=0x7fc0580f72d0 pc=0x7fc04165d945
runtime.makeslice(0x7fc04172dd67?, 0x7fc05922ed70?, 0x7fc058914c48?)
	/opt/ego/go/src/runtime/slice.go:103 +0x52 fp=0x7fc0580f7370 sp=0x7fc0580f7348 pc=0x7fc04169d772
github.com/ethereum/go-ethereum/ethdb/memorydb.(*Database).NewIterator(0x7fc05806cc60, {0x7fc05922ed70, 0xa, 0x10}, {0x0, 0x0, 0x7fc0424a0c01?})
	/root/go/pkg/mod/github.com/ethereum/[email protected]/ethdb/memorydb/memorydb.go:143 +0x205 fp=0x7fc0580f7528 sp=0x7fc0580f7370 pc=0x7fc0419321c5
github.com/ethereum/go-ethereum/core/rawdb.(*nofreezedb).NewIterator(0x7fc0588dd280?, {0x7fc05922ed70?, 0x0?, 0x7fc04171eb80?}, {0x0?, 0x7fc0580f7588?, 0x7fc0580f7608?})
	<autogenerated>:1 +0x34 fp=0x7fc0580f7570 sp=0x7fc0580f7528 pc=0x7fc04194cc94
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave/rawdb.ReadAllHashes({0x7fc055e4a5a8, 0x7fc05803b4b0}, 0x2?)
	/obscuro-playground/go/obscuronode/enclave/rawdb/accessors_chain.go:144 +0x11d fp=0x7fc0580f7698 sp=0x7fc0580f7570 pc=0x7fc0419c3f3d
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave/rawdb.ReadRollupsForHeight({0x7fc04204cef0?, 0x7fc05803b4b0}, 0x7fc05811bcd0?)
	/obscuro-playground/go/obscuronode/enclave/rawdb/accessors_chain.go:130 +0x67 fp=0x7fc0580f7730 sp=0x7fc0580f7698 pc=0x7fc0419c3d07
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave/db.(*storageImpl).FetchRollups(0x103a?, 0x7fc041d53e37?)
	/obscuro-playground/go/obscuronode/enclave/db/storage.go:69 +0x2a fp=0x7fc0580f7758 sp=0x7fc0580f7730 pc=0x7fc0419c50ea
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave.(*enclaveImpl).RoundWinner(0x7fc058234bb0, {0xd9, 0x5c, 0x68, 0x71, 0x67, 0x4f, 0x49, 0x8e, 0xc8, ...})
	/obscuro-playground/go/obscuronode/enclave/enclave.go:270 +0xfd fp=0x7fc0580f79e0 sp=0x7fc0580f7758 pc=0x7fc041d1dd9d
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave.(*server).RoundWinner(0x7fc05806cc20?, {0x7fc0581cbf00?, 0x7fc04176cf06?}, 0x7fc0582bb1e0?)
	/obscuro-playground/go/obscuronode/enclave/server.go:152 +0xc6 fp=0x7fc0580f7ab0 sp=0x7fc0580f79e0 pc=0x7fc041d233e6
github.com/obscuronet/obscuro-playground/go/obscuronode/nodecommon/rpc/generated._EnclaveProto_RoundWinner_Handler({0x7fc042010ee0?, 0x7fc05806cc20}, {0x7fc0420481d0, 0x7fc058938d80}, 0x7fc0584c00c0, 0x0)
	/obscuro-playground/go/obscuronode/nodecommon/rpc/generated/enclave_grpc.pb.go:561 +0x170 fp=0x7fc0580f7b08 sp=0x7fc0580f7ab0 pc=0x7fc041d18e30
google.golang.org/grpc.(*Server).processUnaryRPC(0x7fc058239500, {0x7fc04204b2f0, 0x7fc058135520}, 0x7fc05827b320, 0x7fc0582b8960, 0x7fc042496cd8, 0x0)
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1282 +0xccf fp=0x7fc0580f7e48 sp=0x7fc0580f7b08 pc=0x7fc041cfda4f
google.golang.org/grpc.(*Server).handleStream(0x7fc058239500, {0x7fc04204b2f0, 0x7fc058135520}, 0x7fc05827b320, 0x0)
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1619 +0xa1b fp=0x7fc0580f7f68 sp=0x7fc0580f7e48 pc=0x7fc041d0207b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:921 +0x98 fp=0x7fc0580f7fe0 sp=0x7fc0580f7f68 pc=0x7fc041cfb5b8
runtime.goexit()
	/opt/ego/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0x7fc0580f7fe8 sp=0x7fc0580f7fe0 pc=0x7fc0416b8d61
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:919 +0x28a

goroutine 1 [chan receive, 137 minutes]:
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave/enclaverunner.handleInterrupt(0x7fc05803b500)
	/obscuro-playground/go/obscuronode/enclave/enclaverunner/enclave_runner.go:57 +0x91
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave/enclaverunner.RunEnclave({0x2, {0x7fc042850890, 0x6}, {0x7fc041eae3b8, 0x0}, 0x0, {0x7fc041d4dd94, 0x10}})
	/obscuro-playground/go/obscuronode/enclave/enclaverunner/enclave_runner.go:33 +0x1fc
main.main()
	/obscuro-playground/go/obscuronode/enclave/main/main.go:12 +0xe5

goroutine 21 [chan receive, 137 minutes]:
github.com/ethereum/go-ethereum/core.(*txSenderCacher).cache(0x0?)
	/root/go/pkg/mod/github.com/ethereum/[email protected]/core/tx_cacher.go:63 +0x3b
created by github.com/ethereum/go-ethereum/core.newTxSenderCacher
	/root/go/pkg/mod/github.com/ethereum/[email protected]/core/tx_cacher.go:55 +0x75

goroutine 22 [chan receive, 137 minutes]:
github.com/ethereum/go-ethereum/core.(*txSenderCacher).cache(0x0?)
	/root/go/pkg/mod/github.com/ethereum/[email protected]/core/tx_cacher.go:63 +0x3b
created by github.com/ethereum/go-ethereum/core.newTxSenderCacher
	/root/go/pkg/mod/github.com/ethereum/[email protected]/core/tx_cacher.go:55 +0x75

goroutine 23 [chan receive]:
github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick(0x7fc0424fa4e0)
	/root/go/pkg/mod/github.com/ethereum/[email protected]/metrics/meter.go:290 +0x65
created by github.com/ethereum/go-ethereum/metrics.NewMeterForced
	/root/go/pkg/mod/github.com/ethereum/[email protected]/metrics/meter.go:71 +0xc5

goroutine 24 [select]:
github.com/ethereum/go-ethereum/consensus/ethash.(*remoteSealer).loop(0x7fc0580fab40)
	/root/go/pkg/mod/github.com/ethereum/[email protected]/consensus/ethash/sealer.go:279 +0x205
created by github.com/ethereum/go-ethereum/consensus/ethash.startRemoteSealer
	/root/go/pkg/mod/github.com/ethereum/[email protected]/consensus/ethash/sealer.go:263 +0x319

goroutine 27 [select]:
google.golang.org/grpc/internal/transport.(*controlBuffer).get(0x7fc05808b180, 0x1)
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:407 +0x115
google.golang.org/grpc/internal/transport.(*loopyWriter).run(0x7fc05807f980)
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:534 +0x85
google.golang.org/grpc/internal/transport.NewServerTransport.func2()
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_server.go:326 +0xc6
created by google.golang.org/grpc/internal/transport.NewServerTransport
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_server.go:323 +0x1833

goroutine 28 [select, 18 minutes]:
google.golang.org/grpc/internal/transport.(*http2Server).keepalive(0x7fc058135520)
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_server.go:1125 +0x233
created by google.golang.org/grpc/internal/transport.NewServerTransport
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_server.go:335 +0x1878

goroutine 7 [IO wait, 137 minutes]:
internal/poll.runtime_pollWait(0x7fc055e471b8, 0x72)
	/opt/ego/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0x7fc058216400?, 0x7fc05803e500?, 0x0)
	/opt/ego/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/opt/ego/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Accept(0x7fc058216400)
	/opt/ego/go/src/internal/poll/fd_unix.go:614 +0x22c
net.(*netFD).accept(0x7fc058216400)
	/opt/ego/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0x7fc05800e648)
	/opt/ego/go/src/net/tcpsock_posix.go:139 +0x28
net.(*TCPListener).Accept(0x7fc05800e648)
	/opt/ego/go/src/net/tcpsock.go:288 +0x3d
google.golang.org/grpc.(*Server).Serve(0x7fc058239500, {0x7fc042047948, 0x7fc05800e648})
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:779 +0x362
github.com/obscuronet/obscuro-playground/go/obscuronode/enclave.StartServer.func1({0x7fc042047948, 0x7fc05800e648})
	/obscuro-playground/go/obscuronode/enclave/server.go:53 +0x9d
created by github.com/obscuronet/obscuro-playground/go/obscuronode/enclave.StartServer
	/obscuro-playground/go/obscuronode/enclave/server.go:51 +0x371

goroutine 9 [syscall, 137 minutes]:
os/signal.signal_recv()
	/opt/ego/go/src/runtime/sigqueue.go:151 +0x2f
os/signal.loop()
	/opt/ego/go/src/os/signal/signal_unix.go:23 +0x19
created by os/signal.Notify.func1.1
	/opt/ego/go/src/os/signal/signal.go:151 +0x2a

goroutine 29 [runnable]:
syscall.Syscall(0x0, 0x8, 0x7fc0581f4000, 0x8000)
	/opt/ego/go/src/syscall/asm_linux_amd64.s:20 +0x5
syscall.read(0x7fc0580fcc00?, {0x7fc0581f4000?, 0x1007fc041eae400?, 0x7fc041664725?})
	/opt/ego/go/src/syscall/zsyscall_linux_amd64.go:696 +0x4d
syscall.Read(...)
	/opt/ego/go/src/syscall/syscall_unix.go:188
internal/poll.ignoringEINTRIO(...)
	/opt/ego/go/src/internal/poll/fd_unix.go:794
internal/poll.(*FD).Read(0x7fc0580fcc00?, {0x7fc0581f4000?, 0x8000?, 0x8000?})
	/opt/ego/go/src/internal/poll/fd_unix.go:163 +0x285
net.(*netFD).Read(0x7fc0580fcc00, {0x7fc0581f4000?, 0x7fc04285f108?, 0x18?})
	/opt/ego/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0x7fc0580ac740, {0x7fc0581f4000?, 0x7fc041f9b340?, 0x2758010001?})
	/opt/ego/go/src/net/net.go:183 +0x45
bufio.(*Reader).Read(0x7fc058088cc0, {0x7fc05811e2e0, 0x9, 0x7fc058914be8?})
	/opt/ego/go/src/bufio/bufio.go:236 +0x1b4
io.ReadAtLeast({0x7fc042042068, 0x7fc058088cc0}, {0x7fc05811e2e0, 0x9, 0x9}, 0x9)
	/opt/ego/go/src/io/io.go:331 +0x9a
io.ReadFull(...)
	/opt/ego/go/src/io/io.go:350
golang.org/x/net/http2.readFrameHeader({0x7fc05811e2e0?, 0x9?, 0x7fc058082080?}, {0x7fc042042068?, 0x7fc058088cc0?})
	/root/go/pkg/mod/golang.org/x/[email protected]/http2/frame.go:237 +0x6e
golang.org/x/net/http2.(*Framer).ReadFrame(0x7fc05811e2a0)
	/root/go/pkg/mod/golang.org/x/[email protected]/http2/frame.go:498 +0x95
google.golang.org/grpc/internal/transport.(*http2Server).HandleStreams(0x7fc058135520, 0x0?, 0x0?)
	/root/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_server.go:605 +0xb2
google.golang.org/grpc.(*Server).serveStreams(0x7fc058239500, {0x7fc04204b2f0?, 0x7fc058135520})
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:905 +0x142
google.golang.org/grpc.(*Server).handleRawConn.func1()
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:847 +0x46
created by google.golang.org/grpc.(*Server).handleRawConn
	/root/go/pkg/mod/google.golang.org/[email protected]/server.go:846 +0x185

Make Obscuroscan RESTful

Obscuroscan.io currently provides an API for the front-end HTML page to call.

  1. This currently requires the use of POST HTTP verbs. I propose that the API is changed to support GET verbs in the case of information retrieval, and that each resource (e.g. block / rollup / transaction) is assigned a URL which may be used to extract information about it.

So, for example, in order to retrieve information about a particular rollup, instead of the following
URL: http://testnet.obscuroscan.io/api/rollup/
Method: POST
Payload: 0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004

Clients could use the following
URL: http://testnet.obscuroscan.io/rollup/0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004
Method: GET
Header: Accept: application/json or text/html

  1. Provide a RESTful endpoint for transaction data, e.g.
    URL: http://testnet.obscuroscan.io/transaction/0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004
    Method: GET
    Header: Accept: application/json or text/html

Reasons:

  1. Make it easier for app developers to link to Obscuroscan, and to particular resources, in order to demonstrate the power of Obscuro. For example, I'd like to link events being displayed in The Guessing Game ("Your guess was incorrect") to the corresponding transaction on Obscuroscan, where users could see both the encrypted and decrypted transaction details.
  2. Align to other block explorers, like Etherscan. e.g. https://etherscan.io/block/15845848 or https://etherscan.io/tx/0x376b11c3a375336463d7163b3c55606f06d9e21df129a2db3b85cd12ba5430f8
  3. Follow REST conventions and HTTP semantics. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

Wallet Extension does not work when built

Steps to reproduce, following instructions at https://github.com/obscuronet/go-obscuro/tree/main/tools/walletextension:

jwgcarlyle@penguin:~/github.com/obscuronet/go-obscuro/tools/walletextension$ env GOOS=linux GOARCH=amd64 go build -o ../bin/wallet_extension_linux_amd64 .
jwgcarlyle@penguin:~/github.com/obscuronet/go-obscuro/tools/walletextension$ chmod +777 ../bin/wallet_extension_linux_amd64 
jwgcarlyle@penguin:~/github.com/obscuronet/go-obscuro/tools/walletextension$ ../bin/wallet_extension_linux_amd64 
../bin/wallet_extension_linux_amd64: line 1: syntax error near unexpected token `newline'
../bin/wallet_extension_linux_amd64: line 1: `!<arch>'

Next Nonce issue

There's an issue with

func NextNonce(cl *obscuroclient.Client, w wallet.Wallet) uint64 {
	// only returns the nonce when the previous transaction was recorded
	for {
		result := readNonce(cl, w.Address())
		if result == w.GetNonce() {
			return w.GetNonceAndIncrement()
		}
		time.Sleep(time.Millisecond)
	}
}

If this breaks for some reason, no other transaction goes through for that operation.
If no other tx goes through, the simulation just thinks it's ok, because theres no more txs to check.

Node-1 not services obscuronscan API endpoints

See summary at https://discord.com/channels/916052669955727371/945360340613484684/1044899720549642320, and as below;

It's deploying fine AFAIS, ERC20 contracts are deployed, and I am able to run 95% of my tests successfully against it. 
In all my tests the wallet extension is configured against dev-testnet.obscu.ro and port 13000, and I transact through that. 
Even though I am transacting I don't see any logging in datadog for any particular transaction hashes which is odd. If I use 
the same node details to request total or latest transactions via the obscuroscan_* endpoints it returns zero or nil. If I try 
and get the rollup for a transaction that I received a transaction receipt from, it tells me no rollup contains that transaction.

dev-testnet.obscu.ro  actually routes to node-1 which is dev-obscuronode-1-testnet-112.uksouth.cloudapp.azure.com and
 is the validator node.  If instead of going to dev-testnet.obscu.ro to hit the obascuroscan_ endpoints we go to node-0 at 
dev-obscuronode-0-testnet-112.uksouth.cloudapp.azure.com which is the aggregator node we see the transactions. So it 
seems somehow node-1 is not responding as we expect to requests on these endpoints. Is this fair?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.