mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
222bb666e9
``` ➜ erigon-lib git:(fieldalign) ✗ fieldalignment -fix ./... /Users/estensen/Developer/erigon-lib/commitment/bin_patricia_hashed.go:81:16: struct of size 1065120 could be 1065112 /Users/estensen/Developer/erigon-lib/commitment/bin_patricia_hashed.go:1063:14: struct of size 1032 could be 1024 /Users/estensen/Developer/erigon-lib/commitment/hex_patricia_hashed.go:62:24: struct of size 952776 could be 952768 /Users/estensen/Developer/erigon-lib/commitment/hex_patricia_hashed.go:98:12: struct of size 1832 could be 1824 /Users/estensen/Developer/erigon-lib/commitment/hex_patricia_hashed.go:113:12: struct with 208 pointer bytes could be 152 /Users/estensen/Developer/erigon-lib/commitment/hex_patricia_hashed.go:143:11: struct of size 464 could be 456 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:24:11: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:79:11: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:134:11: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:189:11: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:244:12: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:299:12: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:355:19: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:418:23: struct with 168 pointer bytes could be 128 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:571:20: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:626:20: struct with 136 pointer bytes could be 128 /Users/estensen/Developer/erigon-lib/gointerfaces/types/types.pb.go:721:15: struct of size 168 could be 160 /Users/estensen/Developer/erigon-lib/etl/buffers.go:75:21: struct with 88 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/etl/buffers.go:182:27: struct with 56 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/etl/buffers.go:274:32: struct with 56 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/etl/collector.go:41:16: struct with 72 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/etl/etl.go:66:20: struct with 96 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/etl/heap.go:25:15: struct with 40 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/patricia/patricia.go:29:11: struct with 40 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/patricia/patricia.go:347:12: struct with 32 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/patricia/patricia.go:367:18: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/patricia/patricia.go:377:19: struct with 168 pointer bytes could be 144 /Users/estensen/Developer/erigon-lib/compress/compress.go:52:17: struct with 176 pointer bytes could be 136 /Users/estensen/Developer/erigon-lib/compress/compress.go:241:24: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/compress/compress.go:327:14: struct with 40 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/compress/compress.go:353:18: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/compress/compress.go:450:19: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/compress/compress.go:670:21: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/compress/compress.go:734:23: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/compress/decompress.go:31:15: struct with 32 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/compress/decompress.go:39:19: struct with 40 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/compress/decompress.go:117:15: struct with 64 pointer bytes could be 56 /Users/estensen/Developer/erigon-lib/compress/decompress.go:125:19: struct with 96 pointer bytes could be 80 /Users/estensen/Developer/erigon-lib/compress/decompress.go:386:13: struct with 64 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/compress/parallel_compress.go:208:22: struct with 16 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/recsplit/golomb_rice.go:32:17: struct with 16 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/recsplit/index.go:35:12: struct of size 432 could be 424 /Users/estensen/Developer/erigon-lib/recsplit/index_reader.go:26:18: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/recsplit/recsplit.go:64:15: struct of size 704 could be 680 /Users/estensen/Developer/erigon-lib/recsplit/recsplit.go:111:19: struct of size 104 could be 96 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:171:17: struct of size 640 could be 632 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:198:17: struct with 168 pointer bytes could be 144 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:389:14: struct with 584 pointer bytes could be 568 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:921:21: struct with 72 pointer bytes could be 56 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:1195:22: struct with 2432 pointer bytes could be 2416 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:2123:13: struct with 2448 pointer bytes could be 2416 /Users/estensen/Developer/erigon-lib/aggregator/aggregator.go:2634:17: struct with 96 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/aggregator/history.go:39:14: struct with 96 pointer bytes could be 88 /Users/estensen/Developer/erigon-lib/bptree/binary_file.go:33:17: struct with 40 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/bptree/node.go:79:13: struct of size 88 could be 80 /Users/estensen/Developer/erigon-lib/chain/chain_config.go:28:13: struct with 136 pointer bytes could be 120 /Users/estensen/Developer/erigon-lib/common/background/progress.go:26:18: struct with 40 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/gointerfaces/downloader/downloader.pb.go:25:19: struct with 64 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/downloader/downloader.pb.go:80:22: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/downloader/downloader.pb.go:127:20: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/downloader/downloader.pb.go:165:19: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/downloader/downloader.pb.go:203:17: struct of size 104 could be 96 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:135:23: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:173:21: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:220:24: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:258:22: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:305:26: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:343:24: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:390:30: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:437:26: struct of size 72 could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:500:30: struct with 64 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:563:28: struct with 64 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:626:37: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:681:35: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:736:29: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:774:27: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:821:27: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:859:25: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:906:23: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:953:21: struct of size 72 could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1008:24: struct of size 104 could be 88 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1079:25: struct of size 144 could be 136 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1190:19: struct with 56 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1245:17: struct with 72 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1300:23: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1347:21: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1394:23: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1441:21: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1488:17: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/ethbackend.pb.go:1535:24: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:220:13: struct of size 120 could be 112 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:299:11: struct of size 104 could be 96 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:370:20: struct with 56 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:425:20: struct of size 136 could be 128 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:513:23: struct with 56 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:585:18: struct of size 112 could be 104 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:664:25: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:719:23: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/remote/kv.pb.go:757:21: struct with 72 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:300:26: struct of size 72 could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:355:35: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:410:29: struct with 56 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:465:38: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:520:16: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:567:26: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:622:26: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:677:21: struct of size 80 could be 72 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:740:12: struct with 56 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:795:17: struct with 72 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:874:21: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:912:21: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:959:22: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1006:17: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1053:23: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1091:21: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1138:22: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1185:20: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1232:24: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/sentry/sentry.pb.go:1270:16: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:25:28: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:63:26: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:110:26: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:148:24: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:195:27: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:233:25: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:280:21: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:318:19: struct with 96 pointer bytes could be 80 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:389:24: struct with 96 pointer bytes could be 88 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:452:22: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:499:28: struct with 56 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:554:26: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:601:22: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:639:20: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:686:20: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/mining.pb.go:724:18: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:132:15: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:179:17: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:226:15: struct with 72 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:281:26: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:328:24: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:375:19: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:413:17: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:460:17: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:498:15: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:545:19: struct with 48 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:592:20: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:630:18: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:693:19: struct with 48 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:740:17: struct of size 56 could be 48 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:795:18: struct of size 80 could be 72 /Users/estensen/Developer/erigon-lib/gointerfaces/txpool/txpool.pb.go:858:22: struct of size 80 could be 72 /Users/estensen/Developer/erigon-lib/direct/sentry_client.go:171:25: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/kv/mdbx/kv_mdbx.go:50:15: struct with 104 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/kv/mdbx/kv_mdbx.go:355:13: struct with 160 pointer bytes could be 152 /Users/estensen/Developer/erigon-lib/kv/memdb/memory_mutation_cursor.go:39:27: struct with 200 pointer bytes could be 184 /Users/estensen/Developer/erigon-lib/kv/remotedb/kv_remote.go:22:17: struct with 72 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/kv/remotedb/kv_remote.go:38:15: struct with 80 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/kv/remotedbserver/server.go:314:24: struct with 40 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/state/aggregator.go:44:17: struct with 192 pointer bytes could be 128 /Users/estensen/Developer/erigon-lib/state/aggregator.go:422:13: struct of size 384 could be 360 /Users/estensen/Developer/erigon-lib/state/aggregator.go:455:26: struct with 424 pointer bytes could be 368 /Users/estensen/Developer/erigon-lib/state/aggregator.go:853:22: struct with 24 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/state/aggregator22.go:37:19: struct with 176 pointer bytes could be 136 /Users/estensen/Developer/erigon-lib/state/aggregator22.go:643:15: struct of size 240 could be 216 /Users/estensen/Developer/erigon-lib/state/aggregator22.go:674:28: struct with 272 pointer bytes could be 224 /Users/estensen/Developer/erigon-lib/state/aggregator22.go:1126:26: struct with 104 pointer bytes could be 88 /Users/estensen/Developer/erigon-lib/state/aggregator22.go:1156:23: struct with 24 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/state/domain.go:52:16: struct with 32 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/state/domain.go:89:13: struct with 120 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/state/domain.go:399:17: struct with 96 pointer bytes could be 64 /Users/estensen/Developer/erigon-lib/state/domain.go:443:14: struct with 32 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/state/domain.go:594:16: struct with 72 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/state/history.go:48:14: struct with 72 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/state/history.go:435:20: struct with 48 pointer bytes could be 32 /Users/estensen/Developer/erigon-lib/state/history.go:529:23: struct with 40 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/state/history.go:1150:23: struct of size 344 could be 336 /Users/estensen/Developer/erigon-lib/state/inverted_index.go:46:20: struct with 128 pointer bytes could be 88 /Users/estensen/Developer/erigon-lib/state/inverted_index.go:389:23: struct with 136 pointer bytes could be 88 /Users/estensen/Developer/erigon-lib/state/inverted_index.go:541:24: struct with 184 pointer bytes could be 152 /Users/estensen/Developer/erigon-lib/state/merge.go:69:19: struct of size 72 could be 56 /Users/estensen/Developer/erigon-lib/state/merge.go:143:20: struct of size 48 could be 40 /Users/estensen/Developer/erigon-lib/state/read_indices.go:29:18: struct with 64 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/state/read_indices.go:211:14: struct of size 72 could be 56 /Users/estensen/Developer/erigon-lib/state/read_indices.go:233:27: struct with 72 pointer bytes could be 56 /Users/estensen/Developer/erigon-lib/state/state_recon.go:61:16: struct with 56 pointer bytes could be 16 /Users/estensen/Developer/erigon-lib/state/state_recon.go:112:19: struct with 136 pointer bytes could be 112 /Users/estensen/Developer/erigon-lib/state/state_recon.go:190:22: struct with 128 pointer bytes could be 112 /Users/estensen/Developer/erigon-lib/types/testdata.go:81:26: struct with 40 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/types/txn.go:46:21: struct with 400 pointer bytes could be 40 /Users/estensen/Developer/erigon-lib/types/txn.go:82:13: struct with 200 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/types/txn.go:691:18: struct with 32 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/txpool/fetch.go:43:12: struct with 136 pointer bytes could be 112 /Users/estensen/Developer/erigon-lib/txpool/pool.go:69:13: struct with 104 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/txpool/pool.go:221:13: struct of size 104 could be 96 /Users/estensen/Developer/erigon-lib/txpool/pool.go:291:13: struct with 336 pointer bytes could be 288 /Users/estensen/Developer/erigon-lib/txpool/pool.go:1789:29: struct with 32 pointer bytes could be 8 /Users/estensen/Developer/erigon-lib/txpool/pool.go:1819:19: struct with 32 pointer bytes could be 24 /Users/estensen/Developer/erigon-lib/txpool/pool.go:1994:18: struct of size 64 could be 56 /Users/estensen/Developer/erigon-lib/txpool/pool.go:2102:14: struct of size 64 could be 56 /Users/estensen/Developer/erigon-lib/txpool/send.go:37:11: struct with 64 pointer bytes could be 48 /Users/estensen/Developer/erigon-lib/txpool/test_util.go:31:17: struct with 72 pointer bytes could be 40 ```
598 lines
17 KiB
Go
598 lines
17 KiB
Go
package remotedb
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"github.com/ledgerwatch/log/v3"
|
|
"golang.org/x/sync/semaphore"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/gointerfaces"
|
|
"github.com/ledgerwatch/erigon-lib/gointerfaces/grpcutil"
|
|
"github.com/ledgerwatch/erigon-lib/gointerfaces/remote"
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
|
)
|
|
|
|
// generate the messages and services
|
|
type remoteOpts struct {
|
|
remoteKV remote.KVClient
|
|
log log.Logger
|
|
bucketsCfg mdbx.TableCfgFunc
|
|
DialAddress string
|
|
version gointerfaces.Version
|
|
}
|
|
|
|
type RemoteKV struct {
|
|
remoteKV remote.KVClient
|
|
log log.Logger
|
|
buckets kv.TableCfg
|
|
roTxsLimiter *semaphore.Weighted
|
|
opts remoteOpts
|
|
}
|
|
|
|
type remoteTx struct {
|
|
stream remote.KV_TxClient
|
|
ctx context.Context
|
|
streamCancelFn context.CancelFunc
|
|
db *RemoteKV
|
|
statelessCursors map[string]kv.Cursor
|
|
cursors []*remoteCursor
|
|
id uint64
|
|
streamingRequested bool
|
|
}
|
|
|
|
type remoteCursor struct {
|
|
ctx context.Context
|
|
stream remote.KV_TxClient
|
|
tx *remoteTx
|
|
bucketName string
|
|
bucketCfg kv.TableCfgItem
|
|
id uint32
|
|
}
|
|
|
|
type remoteCursorDupSort struct {
|
|
*remoteCursor
|
|
}
|
|
|
|
func (opts remoteOpts) ReadOnly() remoteOpts {
|
|
return opts
|
|
}
|
|
|
|
func (opts remoteOpts) WithBucketsConfig(f mdbx.TableCfgFunc) remoteOpts {
|
|
opts.bucketsCfg = f
|
|
return opts
|
|
}
|
|
|
|
func (opts remoteOpts) Open() (*RemoteKV, error) {
|
|
targetSemCount := int64(runtime.GOMAXPROCS(-1)) - 1
|
|
if targetSemCount <= 1 {
|
|
targetSemCount = 2
|
|
}
|
|
|
|
db := &RemoteKV{
|
|
opts: opts,
|
|
remoteKV: opts.remoteKV,
|
|
log: log.New("remote_db", opts.DialAddress),
|
|
buckets: kv.TableCfg{},
|
|
roTxsLimiter: semaphore.NewWeighted(targetSemCount), // 1 less than max to allow unlocking
|
|
}
|
|
customBuckets := opts.bucketsCfg(kv.ChaindataTablesCfg)
|
|
for name, cfg := range customBuckets { // copy map to avoid changing global variable
|
|
db.buckets[name] = cfg
|
|
}
|
|
|
|
return db, nil
|
|
}
|
|
|
|
func (opts remoteOpts) MustOpen() kv.RwDB {
|
|
db, err := opts.Open()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return db
|
|
}
|
|
|
|
// NewRemote defines new remove KV connection (without actually opening it)
|
|
// version parameters represent the version the KV client is expecting,
|
|
// compatibility check will be performed when the KV connection opens
|
|
func NewRemote(v gointerfaces.Version, logger log.Logger, remoteKV remote.KVClient) remoteOpts {
|
|
return remoteOpts{bucketsCfg: mdbx.WithChaindataTables, version: v, log: logger, remoteKV: remoteKV}
|
|
}
|
|
|
|
func (db *RemoteKV) PageSize() uint64 { panic("not implemented") }
|
|
func (db *RemoteKV) AllBuckets() kv.TableCfg { return db.buckets }
|
|
|
|
func (db *RemoteKV) EnsureVersionCompatibility() bool {
|
|
versionReply, err := db.remoteKV.Version(context.Background(), &emptypb.Empty{}, grpc.WaitForReady(true))
|
|
if err != nil {
|
|
db.log.Error("getting Version", "error", err)
|
|
return false
|
|
}
|
|
if !gointerfaces.EnsureVersion(db.opts.version, versionReply) {
|
|
db.log.Error("incompatible interface versions", "client", db.opts.version.String(),
|
|
"server", fmt.Sprintf("%d.%d.%d", versionReply.Major, versionReply.Minor, versionReply.Patch))
|
|
return false
|
|
}
|
|
db.log.Info("interfaces compatible", "client", db.opts.version.String(),
|
|
"server", fmt.Sprintf("%d.%d.%d", versionReply.Major, versionReply.Minor, versionReply.Patch))
|
|
return true
|
|
}
|
|
|
|
func (db *RemoteKV) Close() {}
|
|
|
|
func (db *RemoteKV) BeginRo(ctx context.Context) (txn kv.Tx, err error) {
|
|
select {
|
|
case <-ctx.Done():
|
|
return nil, ctx.Err()
|
|
default:
|
|
}
|
|
|
|
if semErr := db.roTxsLimiter.Acquire(ctx, 1); semErr != nil {
|
|
return nil, semErr
|
|
}
|
|
|
|
defer func() {
|
|
// ensure we release the semaphore on error
|
|
if txn == nil {
|
|
db.roTxsLimiter.Release(1)
|
|
}
|
|
}()
|
|
|
|
streamCtx, streamCancelFn := context.WithCancel(ctx) // We create child context for the stream so we can cancel it to prevent leak
|
|
stream, err := db.remoteKV.Tx(streamCtx)
|
|
if err != nil {
|
|
streamCancelFn()
|
|
return nil, err
|
|
}
|
|
msg, err := stream.Recv()
|
|
if err != nil {
|
|
streamCancelFn()
|
|
return nil, err
|
|
}
|
|
return &remoteTx{ctx: ctx, db: db, stream: stream, streamCancelFn: streamCancelFn, id: msg.TxID}, nil
|
|
}
|
|
|
|
func (db *RemoteKV) BeginRw(ctx context.Context) (kv.RwTx, error) {
|
|
return nil, fmt.Errorf("remote db provider doesn't support .BeginRw method")
|
|
}
|
|
|
|
func (db *RemoteKV) View(ctx context.Context, f func(tx kv.Tx) error) (err error) {
|
|
tx, err := db.BeginRo(ctx)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer tx.Rollback()
|
|
|
|
return f(tx)
|
|
}
|
|
|
|
func (db *RemoteKV) Update(ctx context.Context, f func(tx kv.RwTx) error) (err error) {
|
|
return fmt.Errorf("remote db provider doesn't support .Update method")
|
|
}
|
|
|
|
func (tx *remoteTx) ViewID() uint64 { return tx.id }
|
|
func (tx *remoteTx) CollectMetrics() {}
|
|
func (tx *remoteTx) IncrementSequence(bucket string, amount uint64) (uint64, error) {
|
|
panic("not implemented yet")
|
|
}
|
|
func (tx *remoteTx) ReadSequence(bucket string) (uint64, error) {
|
|
panic("not implemented yet")
|
|
}
|
|
func (tx *remoteTx) Append(bucket string, k, v []byte) error { panic("no write methods") }
|
|
func (tx *remoteTx) AppendDup(bucket string, k, v []byte) error { panic("no write methods") }
|
|
|
|
func (tx *remoteTx) Commit() error {
|
|
panic("remote db is read-only")
|
|
}
|
|
|
|
func (tx *remoteTx) Rollback() {
|
|
// don't close opened cursors - just close stream, server will cleanup everything well
|
|
tx.closeGrpcStream()
|
|
tx.db.roTxsLimiter.Release(1)
|
|
}
|
|
func (tx *remoteTx) DBSize() (uint64, error) { panic("not implemented") }
|
|
|
|
func (tx *remoteTx) statelessCursor(bucket string) (kv.Cursor, error) {
|
|
if tx.statelessCursors == nil {
|
|
tx.statelessCursors = make(map[string]kv.Cursor)
|
|
}
|
|
c, ok := tx.statelessCursors[bucket]
|
|
if !ok {
|
|
var err error
|
|
c, err = tx.Cursor(bucket)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
tx.statelessCursors[bucket] = c
|
|
}
|
|
return c, nil
|
|
}
|
|
|
|
func (tx *remoteTx) BucketSize(name string) (uint64, error) { panic("not implemented") }
|
|
|
|
// TODO: this must be optimized - and implemented as single command on server, with server-side buffered streaming
|
|
func (tx *remoteTx) ForEach(bucket string, fromPrefix []byte, walker func(k, v []byte) error) error {
|
|
c, err := tx.Cursor(bucket)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer c.Close()
|
|
|
|
for k, v, err := c.Seek(fromPrefix); k != nil; k, v, err = c.Next() {
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := walker(k, v); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// TODO: this must be optimized - and implemented as single command on server, with server-side buffered streaming
|
|
func (tx *remoteTx) ForPrefix(bucket string, prefix []byte, walker func(k, v []byte) error) error {
|
|
c, err := tx.Cursor(bucket)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer c.Close()
|
|
|
|
for k, v, err := c.Seek(prefix); k != nil; k, v, err = c.Next() {
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !bytes.HasPrefix(k, prefix) {
|
|
break
|
|
}
|
|
if err := walker(k, v); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (tx *remoteTx) ForAmount(bucket string, fromPrefix []byte, amount uint32, walker func(k, v []byte) error) error {
|
|
if amount == 0 {
|
|
return nil
|
|
}
|
|
c, err := tx.Cursor(bucket)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer c.Close()
|
|
|
|
for k, v, err := c.Seek(fromPrefix); k != nil && amount > 0; k, v, err = c.Next() {
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := walker(k, v); err != nil {
|
|
return err
|
|
}
|
|
amount--
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (tx *remoteTx) GetOne(bucket string, key []byte) (val []byte, err error) {
|
|
c, err := tx.statelessCursor(bucket)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
_, val, err = c.SeekExact(key)
|
|
return val, err
|
|
}
|
|
|
|
func (tx *remoteTx) Has(bucket string, key []byte) (bool, error) {
|
|
c, err := tx.statelessCursor(bucket)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
k, _, err := c.Seek(key)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
return bytes.Equal(key, k), nil
|
|
}
|
|
|
|
func (c *remoteCursor) SeekExact(key []byte) (k, val []byte, err error) {
|
|
return c.seekExact(key)
|
|
}
|
|
|
|
func (c *remoteCursor) Prev() ([]byte, []byte, error) {
|
|
return c.prev()
|
|
}
|
|
|
|
func (tx *remoteTx) Cursor(bucket string) (kv.Cursor, error) {
|
|
b := tx.db.buckets[bucket]
|
|
c := &remoteCursor{tx: tx, ctx: tx.ctx, bucketName: bucket, bucketCfg: b, stream: tx.stream}
|
|
tx.cursors = append(tx.cursors, c)
|
|
if err := c.stream.Send(&remote.Cursor{Op: remote.Op_OPEN, BucketName: c.bucketName}); err != nil {
|
|
return nil, err
|
|
}
|
|
msg, err := c.stream.Recv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
c.id = msg.CursorID
|
|
return c, nil
|
|
}
|
|
|
|
func (c *remoteCursor) Put(key []byte, value []byte) error { panic("not supported") }
|
|
func (c *remoteCursor) PutNoOverwrite(key []byte, value []byte) error { panic("not supported") }
|
|
func (c *remoteCursor) Append(key []byte, value []byte) error { panic("not supported") }
|
|
func (c *remoteCursor) Delete(k []byte) error { panic("not supported") }
|
|
func (c *remoteCursor) DeleteCurrent() error { panic("not supported") }
|
|
func (c *remoteCursor) Count() (uint64, error) { panic("not supported") }
|
|
|
|
func (c *remoteCursor) first() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_FIRST}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
|
|
func (c *remoteCursor) next() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_NEXT}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) nextDup() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_NEXT_DUP}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) nextNoDup() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_NEXT_NO_DUP}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) prev() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_PREV}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) prevDup() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_PREV_DUP}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) prevNoDup() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_PREV_NO_DUP}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) last() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_LAST}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) setRange(k []byte) ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_SEEK, K: k}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) seekExact(k []byte) ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_SEEK_EXACT, K: k}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) getBothRange(k, v []byte) ([]byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_SEEK_BOTH, K: k, V: v}); err != nil {
|
|
return nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return pair.V, nil
|
|
}
|
|
func (c *remoteCursor) seekBothExact(k, v []byte) ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_SEEK_BOTH_EXACT, K: k, V: v}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
func (c *remoteCursor) firstDup() ([]byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_FIRST_DUP}); err != nil {
|
|
return nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return pair.V, nil
|
|
}
|
|
func (c *remoteCursor) lastDup() ([]byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_LAST_DUP}); err != nil {
|
|
return nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return pair.V, nil
|
|
}
|
|
func (c *remoteCursor) getCurrent() ([]byte, []byte, error) {
|
|
if err := c.stream.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_CURRENT}); err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
pair, err := c.stream.Recv()
|
|
if err != nil {
|
|
return []byte{}, nil, err
|
|
}
|
|
return pair.K, pair.V, nil
|
|
}
|
|
|
|
func (c *remoteCursor) Current() ([]byte, []byte, error) {
|
|
return c.getCurrent()
|
|
}
|
|
|
|
// Seek - doesn't start streaming (because much of code does only several .Seek calls without reading sequence of data)
|
|
// .Next() - does request streaming (if configured by user)
|
|
func (c *remoteCursor) Seek(seek []byte) ([]byte, []byte, error) {
|
|
return c.setRange(seek)
|
|
}
|
|
|
|
func (c *remoteCursor) First() ([]byte, []byte, error) {
|
|
return c.first()
|
|
}
|
|
|
|
// Next - returns next data element from server, request streaming (if configured by user)
|
|
func (c *remoteCursor) Next() ([]byte, []byte, error) {
|
|
return c.next()
|
|
}
|
|
|
|
func (c *remoteCursor) Last() ([]byte, []byte, error) {
|
|
return c.last()
|
|
}
|
|
|
|
func (tx *remoteTx) closeGrpcStream() {
|
|
if tx.stream == nil {
|
|
return
|
|
}
|
|
defer tx.streamCancelFn() // hard cancel stream if graceful wasn't successful
|
|
|
|
if tx.streamingRequested {
|
|
// if streaming is in progress, can't use `CloseSend` - because
|
|
// server will not read it right not - it busy with streaming data
|
|
// TODO: set flag 'tx.streamingRequested' to false when got terminator from server (nil key or os.EOF)
|
|
tx.streamCancelFn()
|
|
} else {
|
|
// try graceful close stream
|
|
err := tx.stream.CloseSend()
|
|
if err != nil {
|
|
doLog := !grpcutil.IsEndOfStream(err)
|
|
if doLog {
|
|
log.Warn("couldn't send msg CloseSend to server", "err", err)
|
|
}
|
|
} else {
|
|
_, err = tx.stream.Recv()
|
|
if err != nil {
|
|
doLog := !grpcutil.IsEndOfStream(err)
|
|
if doLog {
|
|
log.Warn("received unexpected error from server after CloseSend", "err", err)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
tx.stream = nil
|
|
tx.streamingRequested = false
|
|
}
|
|
|
|
func (c *remoteCursor) Close() {
|
|
if c.stream == nil {
|
|
return
|
|
}
|
|
st := c.stream
|
|
c.stream = nil
|
|
if err := st.Send(&remote.Cursor{Cursor: c.id, Op: remote.Op_CLOSE}); err == nil {
|
|
_, _ = st.Recv()
|
|
}
|
|
}
|
|
|
|
func (tx *remoteTx) CursorDupSort(bucket string) (kv.CursorDupSort, error) {
|
|
b := tx.db.buckets[bucket]
|
|
c := &remoteCursor{tx: tx, ctx: tx.ctx, bucketName: bucket, bucketCfg: b, stream: tx.stream}
|
|
tx.cursors = append(tx.cursors, c)
|
|
if err := c.stream.Send(&remote.Cursor{Op: remote.Op_OPEN_DUP_SORT, BucketName: c.bucketName}); err != nil {
|
|
return nil, err
|
|
}
|
|
msg, err := c.stream.Recv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
c.id = msg.CursorID
|
|
return &remoteCursorDupSort{remoteCursor: c}, nil
|
|
}
|
|
|
|
func (c *remoteCursorDupSort) SeekBothExact(key, value []byte) ([]byte, []byte, error) {
|
|
return c.seekBothExact(key, value)
|
|
}
|
|
|
|
func (c *remoteCursorDupSort) SeekBothRange(key, value []byte) ([]byte, error) {
|
|
return c.getBothRange(key, value)
|
|
}
|
|
|
|
func (c *remoteCursorDupSort) DeleteExact(k1, k2 []byte) error { panic("not supported") }
|
|
func (c *remoteCursorDupSort) AppendDup(k []byte, v []byte) error { panic("not supported") }
|
|
func (c *remoteCursorDupSort) PutNoDupData(key, value []byte) error { panic("not supported") }
|
|
func (c *remoteCursorDupSort) DeleteCurrentDuplicates() error { panic("not supported") }
|
|
func (c *remoteCursorDupSort) CountDuplicates() (uint64, error) { panic("not supported") }
|
|
|
|
func (c *remoteCursorDupSort) FirstDup() ([]byte, error) {
|
|
return c.firstDup()
|
|
}
|
|
func (c *remoteCursorDupSort) NextDup() ([]byte, []byte, error) {
|
|
return c.nextDup()
|
|
}
|
|
func (c *remoteCursorDupSort) NextNoDup() ([]byte, []byte, error) {
|
|
return c.nextNoDup()
|
|
}
|
|
func (c *remoteCursorDupSort) PrevDup() ([]byte, []byte, error) {
|
|
return c.prevDup()
|
|
}
|
|
func (c *remoteCursorDupSort) PrevNoDup() ([]byte, []byte, error) {
|
|
return c.prevNoDup()
|
|
}
|
|
func (c *remoteCursorDupSort) LastDup() ([]byte, error) {
|
|
return c.lastDup()
|
|
}
|