diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000000..8104cabd36fb --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.1.0 diff --git a/.gitignore b/.gitignore index 3f27cdc00f07..f1da05c02638 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ profile.cov logs/ tests/spec-tests/ + +# Bazel scratch space +bazel-* diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000000..61a084bae8c8 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,27 @@ +load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "go_library") + +# No need for gazelle:prefix as it reads from go.mod +# libevm/tooling is a different Go/Bazel module +# gazelle:exclude libevm/tooling/** +gazelle( + name = "gazelle", + command = "fix", +) + +gazelle( + name = "gazelle_diff", + command = "fix", + extra_args = ["--mode=diff"], +) + +go_library( + name = "libevm", + srcs = ["interfaces.go"], + importpath = "github.com/ava-labs/libevm", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/types", + ], +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000000..9df32454f5b9 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,32 @@ +"ava-labs/libevm" + +module( + name = "ava-labs_libevm", + version = "", +) + +bazel_dep(name = "rules_go", version = "0.53.0") +bazel_dep(name = "gazelle", version = "0.42.0") + +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download(version = "1.23.6") + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") + +# Do not update this manually; run `bazel mod tidy` to pull it from `go.mod` +use_repo(go_deps, "com_github_aws_aws_sdk_go_v2", "com_github_aws_aws_sdk_go_v2_config", "com_github_aws_aws_sdk_go_v2_credentials", "com_github_aws_aws_sdk_go_v2_service_route53", "com_github_azure_azure_sdk_for_go_sdk_storage_azblob", "com_github_btcsuite_btcd_btcec_v2", "com_github_cespare_cp", "com_github_cloudflare_cloudflare_go", "com_github_cockroachdb_pebble", "com_github_consensys_gnark_crypto", "com_github_crate_crypto_go_ipa", "com_github_crate_crypto_go_kzg_4844", "com_github_davecgh_go_spew", "com_github_deckarep_golang_set_v2", "com_github_dop251_goja", "com_github_ethereum_c_kzg_4844", "com_github_fatih_color", "com_github_ferranbt_fastssz", "com_github_fjl_gencodec", "com_github_fsnotify_fsnotify", "com_github_gballet_go_libpcsclite", "com_github_gballet_go_verkle", "com_github_gofrs_flock", "com_github_golang_jwt_jwt_v4", "com_github_golang_protobuf", "com_github_golang_snappy", "com_github_google_go_cmp", "com_github_google_gofuzz", "com_github_google_uuid", "com_github_gorilla_websocket", "com_github_graph_gophers_graphql_go", "com_github_hashicorp_go_bexpr", "com_github_holiman_billy", "com_github_holiman_bloomfilter_v2", "com_github_holiman_uint256", "com_github_huin_goupnp", "com_github_influxdata_influxdb1_client", "com_github_influxdata_influxdb_client_go_v2", "com_github_jackpal_go_nat_pmp", "com_github_jedisct1_go_minisign", "com_github_julienschmidt_httprouter", "com_github_karalabe_usb", "com_github_kr_pretty", "com_github_kylelemons_godebug", "com_github_mattn_go_colorable", "com_github_mattn_go_isatty", "com_github_microsoft_go_winio", "com_github_naoina_toml", "com_github_olekukonko_tablewriter", "com_github_peterh_liner", "com_github_protolambda_bls12_381_util", "com_github_rs_cors", "com_github_shirou_gopsutil", "com_github_status_im_keycard_go", "com_github_stretchr_testify", "com_github_supranational_blst", "com_github_syndtr_goleveldb", "com_github_tyler_smith_go_bip39", "com_github_urfave_cli_v2", "com_github_victoriametrics_fastcache", "in_gopkg_natefinch_lumberjack_v2", "in_gopkg_yaml_v3", "org_golang_x_crypto", "org_golang_x_exp", "org_golang_x_mod", "org_golang_x_sync", "org_golang_x_sys", "org_golang_x_text", "org_golang_x_time", "org_golang_x_tools", "org_uber_go_automaxprocs") + +CGO_PATCHES = { + "github.com/karalabe/usb": [ + "com_github_karalabe_usb.patch", + ], + "github.com/supranational/blst": [ + "com_github_supranational_blst.patch", + ], +} + +[go_deps.module_override( + patches = ["//libevm/internal/bazel:%s" % f for f in patch_files], + path = path, +) for path, patch_files in CGO_PATCHES.items()] diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 000000000000..eda787b69158 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,259 @@ +{ + "lockFileVersion": 18, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/source.json": "f121b43eeefc7c29efbd51b83d08631e2347297c95aac9764a701f2a6a2bb953", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/gazelle/0.32.0/MODULE.bazel": "b499f58a5d0d3537f3cf5b76d8ada18242f64ec474d8391247438bf04f58c7b8", + "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", + "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", + "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", + "https://bcr.bazel.build/modules/gazelle/0.42.0/MODULE.bazel": "fa140a7c019f3a22779ba7c6132ffff9d2d10a51dba2f3304dee61523d11fef4", + "https://bcr.bazel.build/modules/gazelle/0.42.0/source.json": "eb6f7b0cb76c52d2679164910a01fa6ddcee409e6a7fee06e602ef259f65165c", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/source.json": "4db99b3f55c90ab28d14552aa0632533e3e8e5e9aea0f5c24ac0014282c2a7c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", + "https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8", + "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", + "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", + "https://bcr.bazel.build/modules/rules_go/0.50.1/MODULE.bazel": "b91a308dc5782bb0a8021ad4330c81fea5bda77f96b9e4c117b9b9c8f6665ee0", + "https://bcr.bazel.build/modules/rules_go/0.53.0/MODULE.bazel": "a4ed760d3ac0dbc0d7b967631a9a3fd9100d28f7d9fcf214b4df87d4bfff5f9a", + "https://bcr.bazel.build/modules/rules_go/0.53.0/source.json": "c6dc34fb5bb8838652221a167d8f35ca3c8fdcbff8568f13cc75719802f95cff", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@platforms//host:extension.bzl%host_platform": { + "general": { + "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", + "usagesDigest": "SeQiIN/f8/Qt9vYQk7qcXp4I4wJeEC0RnQDiaaJ4tb8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "host_platform": { + "repoRuleId": "@@platforms//host:extension.bzl%host_platform_repo", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { + "general": { + "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", + "usagesDigest": "jTQDdLDxsS43zuRmg1faAjIEPWdLAbDAowI1pInQSoo=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "compatibility_proxy": { + "repoRuleId": "@@rules_java+//java:rules_java_deps.bzl%_compatibility_proxy_repo_rule", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin+", + "bazel_tools", + "bazel_tools" + ] + ] + } + } + } +} diff --git a/accounts/BUILD.bazel b/accounts/BUILD.bazel new file mode 100644 index 000000000000..7a96565c178f --- /dev/null +++ b/accounts/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "accounts", + srcs = [ + "accounts.go", + "errors.go", + "hd.go", + "manager.go", + "sort.go", + "url.go", + ], + importpath = "github.com/ava-labs/libevm/accounts", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//core/types", + "//event", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "accounts_test", + srcs = [ + "accounts_test.go", + "hd_test.go", + "url_test.go", + ], + embed = [":accounts"], + deps = ["//common/hexutil"], +) diff --git a/accounts/abi/BUILD.bazel b/accounts/abi/BUILD.bazel new file mode 100644 index 000000000000..446657a40810 --- /dev/null +++ b/accounts/abi/BUILD.bazel @@ -0,0 +1,55 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "abi", + srcs = [ + "abi.go", + "argument.go", + "doc.go", + "error.go", + "error_handling.go", + "event.go", + "method.go", + "pack.go", + "reflect.go", + "selector_parser.go", + "topics.go", + "type.go", + "unpack.go", + "utils.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/abi", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//crypto", + ], +) + +go_test( + name = "abi_test", + srcs = [ + "abi_test.go", + "abifuzzer_test.go", + "event_test.go", + "method_test.go", + "pack_test.go", + "packing_test.go", + "reflect_test.go", + "selector_parser_test.go", + "topics_test.go", + "type_test.go", + "unpack_test.go", + ], + embed = [":abi"], + deps = [ + "//common", + "//common/math", + "//crypto", + "@com_github_davecgh_go_spew//spew", + "@com_github_google_gofuzz//:gofuzz", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/accounts/abi/bind/BUILD.bazel b/accounts/abi/bind/BUILD.bazel new file mode 100644 index 000000000000..7a16ab2febbe --- /dev/null +++ b/accounts/abi/bind/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bind", + srcs = [ + "auth.go", + "backend.go", + "base.go", + "bind.go", + "template.go", + "util.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/abi/bind", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//accounts/abi", + "//accounts/external", + "//accounts/keystore", + "//common", + "//core/types", + "//crypto", + "//event", + "//log", + ], +) + +go_test( + name = "bind_test", + srcs = [ + "base_test.go", + "bind_test.go", + "util_test.go", + ], + embed = [":bind"], + deps = [ + "//:libevm", + "//accounts/abi", + "//common", + "//common/hexutil", + "//core/types", + "//crypto", + "//ethclient/simulated", + "//params", + "//rlp", + "@com_github_stretchr_testify//assert", + ], +) diff --git a/accounts/abi/bind/backends/BUILD.bazel b/accounts/abi/bind/backends/BUILD.bazel new file mode 100644 index 000000000000..914fedd4bd7a --- /dev/null +++ b/accounts/abi/bind/backends/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "backends", + srcs = ["simulated.go"], + importpath = "github.com/ava-labs/libevm/accounts/abi/bind/backends", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/types", + "//ethclient/simulated", + ], +) diff --git a/accounts/external/BUILD.bazel b/accounts/external/BUILD.bazel new file mode 100644 index 000000000000..c078d0373fa7 --- /dev/null +++ b/accounts/external/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "external", + srcs = ["backend.go"], + importpath = "github.com/ava-labs/libevm/accounts/external", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//common", + "//common/hexutil", + "//core/types", + "//event", + "//log", + "//rpc", + "//signer/core/apitypes", + ], +) diff --git a/accounts/keystore/BUILD.bazel b/accounts/keystore/BUILD.bazel new file mode 100644 index 000000000000..207df04e49a1 --- /dev/null +++ b/accounts/keystore/BUILD.bazel @@ -0,0 +1,139 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "keystore", + srcs = [ + "account_cache.go", + "file_cache.go", + "key.go", + "keystore.go", + "passphrase.go", + "plain.go", + "presale.go", + "wallet.go", + "watch.go", + "watch_fallback.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/keystore", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//common", + "//common/math", + "//core/types", + "//crypto", + "//event", + "//log", + "@com_github_deckarep_golang_set_v2//:golang-set", + "@com_github_google_uuid//:uuid", + "@org_golang_x_crypto//pbkdf2", + "@org_golang_x_crypto//scrypt", + "@org_golang_x_exp//slices", + ] + select({ + "@rules_go//go/platform:android_386": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:android_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:android_arm": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:darwin_386": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:darwin_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:darwin_arm": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:darwin_arm64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:freebsd_386": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:freebsd_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:freebsd_arm": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:freebsd_arm64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_386": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_arm": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_mips": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_mips64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_mips64le": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_mipsle": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_ppc64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_ppc64le": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_riscv64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:linux_s390x": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:netbsd_386": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:netbsd_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:netbsd_arm": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:netbsd_arm64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "@rules_go//go/platform:solaris_amd64": [ + "@com_github_fsnotify_fsnotify//:fsnotify", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "keystore_test", + srcs = [ + "account_cache_test.go", + "keystore_fuzzing_test.go", + "keystore_test.go", + "passphrase_test.go", + "plain_test.go", + ], + data = glob(["testdata/**"]), + embed = [":keystore"], + deps = [ + "//accounts", + "//common", + "//crypto", + "//event", + "@com_github_cespare_cp//:cp", + "@com_github_davecgh_go_spew//spew", + "@org_golang_x_exp//slices", + ], +) diff --git a/accounts/scwallet/BUILD.bazel b/accounts/scwallet/BUILD.bazel new file mode 100644 index 000000000000..5e40534a7bc3 --- /dev/null +++ b/accounts/scwallet/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "scwallet", + srcs = [ + "apdu.go", + "hub.go", + "securechannel.go", + "wallet.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/scwallet", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//common", + "//core/types", + "//crypto", + "//event", + "//log", + "@com_github_gballet_go_libpcsclite//:go-libpcsclite", + "@com_github_status_im_keycard_go//derivationpath", + "@org_golang_x_crypto//pbkdf2", + "@org_golang_x_text//unicode/norm", + ], +) diff --git a/accounts/usbwallet/BUILD.bazel b/accounts/usbwallet/BUILD.bazel new file mode 100644 index 000000000000..6730c3f5372e --- /dev/null +++ b/accounts/usbwallet/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "usbwallet", + srcs = [ + "hub.go", + "ledger.go", + "trezor.go", + "wallet.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/usbwallet", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//accounts/usbwallet/trezor", + "//common", + "//common/hexutil", + "//core/types", + "//crypto", + "//event", + "//log", + "//rlp", + "@com_github_golang_protobuf//proto", + "@com_github_karalabe_usb//:usb", + ], +) diff --git a/accounts/usbwallet/trezor/BUILD.bazel b/accounts/usbwallet/trezor/BUILD.bazel new file mode 100644 index 000000000000..12b66af02814 --- /dev/null +++ b/accounts/usbwallet/trezor/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "trezor", + srcs = [ + "messages.pb.go", + "messages-common.pb.go", + "messages-ethereum.pb.go", + "messages-management.pb.go", + "trezor.go", + ], + importpath = "github.com/ava-labs/libevm/accounts/usbwallet/trezor", + visibility = ["//visibility:public"], + deps = [ + "@com_github_golang_protobuf//proto", + "@com_github_golang_protobuf//protoc-gen-go/descriptor", + ], +) diff --git a/beacon/engine/BUILD.bazel b/beacon/engine/BUILD.bazel new file mode 100644 index 000000000000..61c69a79b288 --- /dev/null +++ b/beacon/engine/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "engine", + srcs = [ + "errors.go", + "gen_blockparams.go", + "gen_ed.go", + "gen_epe.go", + "types.go", + ], + importpath = "github.com/ava-labs/libevm/beacon/engine", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//core/types", + "//rpc", + "//trie", + ], +) diff --git a/beacon/light/BUILD.bazel b/beacon/light/BUILD.bazel new file mode 100644 index 000000000000..fbd13daa359e --- /dev/null +++ b/beacon/light/BUILD.bazel @@ -0,0 +1,37 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "light", + srcs = [ + "canonical.go", + "committee_chain.go", + "range.go", + "test_helpers.go", + ], + importpath = "github.com/ava-labs/libevm/beacon/light", + visibility = ["//visibility:public"], + deps = [ + "//beacon/merkle", + "//beacon/params", + "//beacon/types", + "//common", + "//common/lru", + "//common/mclock", + "//core/rawdb", + "//ethdb", + "//log", + "//rlp", + ], +) + +go_test( + name = "light_test", + srcs = ["committee_chain_test.go"], + embed = [":light"], + deps = [ + "//beacon/params", + "//beacon/types", + "//common/mclock", + "//ethdb/memorydb", + ], +) diff --git a/beacon/merkle/BUILD.bazel b/beacon/merkle/BUILD.bazel new file mode 100644 index 000000000000..5f823eb2b29e --- /dev/null +++ b/beacon/merkle/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "merkle", + srcs = ["merkle.go"], + importpath = "github.com/ava-labs/libevm/beacon/merkle", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + ], +) diff --git a/beacon/params/BUILD.bazel b/beacon/params/BUILD.bazel new file mode 100644 index 000000000000..16598edc7882 --- /dev/null +++ b/beacon/params/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "params", + srcs = ["params.go"], + importpath = "github.com/ava-labs/libevm/beacon/params", + visibility = ["//visibility:public"], +) diff --git a/beacon/types/BUILD.bazel b/beacon/types/BUILD.bazel new file mode 100644 index 000000000000..d52c59b87452 --- /dev/null +++ b/beacon/types/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "types", + srcs = [ + "committee.go", + "config.go", + "gen_header_json.go", + "gen_syncaggregate_json.go", + "header.go", + "light_sync.go", + ], + importpath = "github.com/ava-labs/libevm/beacon/types", + visibility = ["//visibility:public"], + deps = [ + "//beacon/merkle", + "//beacon/params", + "//common", + "//common/hexutil", + "@com_github_protolambda_bls12_381_util//:bls12-381-util", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) diff --git a/cmd/abidump/BUILD.bazel b/cmd/abidump/BUILD.bazel new file mode 100644 index 000000000000..faa51e7e1a5a --- /dev/null +++ b/cmd/abidump/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "abidump_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/abidump", + visibility = ["//visibility:private"], + deps = [ + "//signer/core/apitypes", + "//signer/fourbyte", + ], +) + +go_binary( + name = "abidump", + embed = [":abidump_lib"], + visibility = ["//visibility:public"], +) diff --git a/cmd/abigen/BUILD.bazel b/cmd/abigen/BUILD.bazel new file mode 100644 index 000000000000..68222f3fac1f --- /dev/null +++ b/cmd/abigen/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "abigen_lib", + srcs = [ + "main.go", + "namefilter.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/abigen", + visibility = ["//visibility:private"], + deps = [ + "//accounts/abi/bind", + "//cmd/utils", + "//common/compiler", + "//crypto", + "//internal/flags", + "//log", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "abigen", + embed = [":abigen_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "abigen_test", + srcs = ["namefilter_test.go"], + embed = [":abigen_lib"], + deps = [ + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/cmd/bootnode/BUILD.bazel b/cmd/bootnode/BUILD.bazel new file mode 100644 index 000000000000..f00ae6f1a8b2 --- /dev/null +++ b/cmd/bootnode/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "bootnode_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/bootnode", + visibility = ["//visibility:private"], + deps = [ + "//cmd/utils", + "//crypto", + "//log", + "//p2p/discover", + "//p2p/enode", + "//p2p/nat", + "//p2p/netutil", + ], +) + +go_binary( + name = "bootnode", + embed = [":bootnode_lib"], + visibility = ["//visibility:public"], +) diff --git a/cmd/clef/BUILD.bazel b/cmd/clef/BUILD.bazel new file mode 100644 index 000000000000..07d7620049cb --- /dev/null +++ b/cmd/clef/BUILD.bazel @@ -0,0 +1,52 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "clef_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/clef", + visibility = ["//visibility:private"], + deps = [ + "//accounts", + "//accounts/keystore", + "//cmd/utils", + "//common", + "//common/hexutil", + "//core/types", + "//crypto", + "//internal/ethapi", + "//internal/flags", + "//log", + "//node", + "//params", + "//rlp", + "//rpc", + "//signer/core", + "//signer/core/apitypes", + "//signer/fourbyte", + "//signer/rules", + "//signer/storage", + "@com_github_mattn_go_colorable//:go-colorable", + "@com_github_mattn_go_isatty//:go-isatty", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "clef", + embed = [":clef_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "clef_test", + srcs = [ + "consolecmd_test.go", + "run_test.go", + ], + data = glob(["testdata/**"]), + embed = [":clef_lib"], + deps = [ + "//internal/cmdtest", + "//internal/reexec", + ], +) diff --git a/cmd/devp2p/BUILD.bazel b/cmd/devp2p/BUILD.bazel new file mode 100644 index 000000000000..e3774867ae65 --- /dev/null +++ b/cmd/devp2p/BUILD.bazel @@ -0,0 +1,66 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "devp2p_lib", + srcs = [ + "crawl.go", + "discv4cmd.go", + "discv5cmd.go", + "dns_cloudflare.go", + "dns_route53.go", + "dnscmd.go", + "enrcmd.go", + "keycmd.go", + "main.go", + "nodeset.go", + "nodesetcmd.go", + "rlpxcmd.go", + "runtest.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/devp2p", + visibility = ["//visibility:private"], + deps = [ + "//accounts/keystore", + "//cmd/devp2p/internal/ethtest", + "//cmd/devp2p/internal/v4test", + "//cmd/devp2p/internal/v5test", + "//common", + "//console/prompt", + "//core", + "//core/forkid", + "//crypto", + "//internal/debug", + "//internal/flags", + "//internal/utesting", + "//log", + "//p2p", + "//p2p/discover", + "//p2p/dnsdisc", + "//p2p/enode", + "//p2p/enr", + "//p2p/rlpx", + "//params", + "//rlp", + "@com_github_aws_aws_sdk_go_v2//aws", + "@com_github_aws_aws_sdk_go_v2_config//:config", + "@com_github_aws_aws_sdk_go_v2_credentials//:credentials", + "@com_github_aws_aws_sdk_go_v2_service_route53//:route53", + "@com_github_aws_aws_sdk_go_v2_service_route53//types", + "@com_github_cloudflare_cloudflare_go//:cloudflare-go", + "@com_github_urfave_cli_v2//:cli", + "@org_golang_x_exp//slices", + ], +) + +go_binary( + name = "devp2p", + embed = [":devp2p_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "devp2p_test", + srcs = ["dns_route53_test.go"], + embed = [":devp2p_lib"], + deps = ["@com_github_aws_aws_sdk_go_v2_service_route53//types"], +) diff --git a/cmd/devp2p/internal/ethtest/BUILD.bazel b/cmd/devp2p/internal/ethtest/BUILD.bazel new file mode 100644 index 000000000000..75b7407e02fc --- /dev/null +++ b/cmd/devp2p/internal/ethtest/BUILD.bazel @@ -0,0 +1,65 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ethtest", + srcs = [ + "chain.go", + "conn.go", + "engine.go", + "protocol.go", + "snap.go", + "suite.go", + "transaction.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/devp2p/internal/ethtest", + visibility = ["//cmd/devp2p:__subpackages__"], + deps = [ + "//common", + "//common/hexutil", + "//consensus/misc/eip4844", + "//core", + "//core/forkid", + "//core/state", + "//core/types", + "//crypto", + "//crypto/kzg4844", + "//eth/protocols/eth", + "//eth/protocols/snap", + "//internal/utesting", + "//p2p", + "//p2p/enode", + "//p2p/rlpx", + "//params", + "//rlp", + "//trie", + "//trie/trienode", + "@com_github_davecgh_go_spew//spew", + "@com_github_golang_jwt_jwt_v4//:jwt", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "ethtest_test", + srcs = [ + "chain_test.go", + "suite_test.go", + ], + data = glob(["testdata/**"]), + embed = [":ethtest"], + deps = [ + "//common", + "//common/hexutil", + "//core/types", + "//eth", + "//eth/catalyst", + "//eth/ethconfig", + "//eth/protocols/eth", + "//internal/utesting", + "//node", + "//p2p", + "@com_github_stretchr_testify//assert", + ], +) diff --git a/cmd/devp2p/internal/v4test/BUILD.bazel b/cmd/devp2p/internal/v4test/BUILD.bazel new file mode 100644 index 000000000000..02dd9f72740d --- /dev/null +++ b/cmd/devp2p/internal/v4test/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "v4test", + srcs = [ + "discv4tests.go", + "framework.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/devp2p/internal/v4test", + visibility = ["//cmd/devp2p:__subpackages__"], + deps = [ + "//crypto", + "//internal/utesting", + "//p2p/discover/v4wire", + "//p2p/enode", + ], +) diff --git a/cmd/devp2p/internal/v5test/BUILD.bazel b/cmd/devp2p/internal/v5test/BUILD.bazel new file mode 100644 index 000000000000..be9bde142fa5 --- /dev/null +++ b/cmd/devp2p/internal/v5test/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "v5test", + srcs = [ + "discv5tests.go", + "framework.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/devp2p/internal/v5test", + visibility = ["//cmd/devp2p:__subpackages__"], + deps = [ + "//common/mclock", + "//crypto", + "//internal/utesting", + "//p2p/discover/v5wire", + "//p2p/enode", + "//p2p/enr", + "//p2p/netutil", + ], +) diff --git a/cmd/era/BUILD.bazel b/cmd/era/BUILD.bazel new file mode 100644 index 000000000000..8394438e75ec --- /dev/null +++ b/cmd/era/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "era_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/era", + visibility = ["//visibility:private"], + deps = [ + "//common", + "//core/types", + "//internal/era", + "//internal/ethapi", + "//internal/flags", + "//params", + "//trie", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "era", + embed = [":era_lib"], + visibility = ["//visibility:public"], +) diff --git a/cmd/ethkey/BUILD.bazel b/cmd/ethkey/BUILD.bazel new file mode 100644 index 000000000000..404852bf2b8b --- /dev/null +++ b/cmd/ethkey/BUILD.bazel @@ -0,0 +1,44 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "ethkey_lib", + srcs = [ + "changepassword.go", + "generate.go", + "inspect.go", + "main.go", + "message.go", + "utils.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/ethkey", + visibility = ["//visibility:private"], + deps = [ + "//accounts", + "//accounts/keystore", + "//cmd/utils", + "//common", + "//crypto", + "//internal/flags", + "@com_github_google_uuid//:uuid", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "ethkey", + embed = [":ethkey_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "ethkey_test", + srcs = [ + "message_test.go", + "run_test.go", + ], + embed = [":ethkey_lib"], + deps = [ + "//internal/cmdtest", + "//internal/reexec", + ], +) diff --git a/cmd/evm/BUILD.bazel b/cmd/evm/BUILD.bazel new file mode 100644 index 000000000000..b442e2a2f17b --- /dev/null +++ b/cmd/evm/BUILD.bazel @@ -0,0 +1,55 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "evm_lib", + srcs = [ + "blockrunner.go", + "compiler.go", + "disasm.go", + "main.go", + "runner.go", + "staterunner.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/evm", + visibility = ["//visibility:private"], + deps = [ + "//cmd/evm/internal/compiler", + "//cmd/evm/internal/t8ntool", + "//cmd/utils", + "//common", + "//core", + "//core/asm", + "//core/rawdb", + "//core/state", + "//core/vm", + "//core/vm/runtime", + "//eth/tracers/js", + "//eth/tracers/logger", + "//eth/tracers/native", + "//internal/debug", + "//internal/flags", + "//params", + "//tests", + "//triedb", + "//triedb/hashdb", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "evm", + embed = [":evm_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "evm_test", + srcs = ["t8n_test.go"], + data = glob(["testdata/**"]), + embed = [":evm_lib"], + deps = [ + "//cmd/evm/internal/t8ntool", + "//internal/cmdtest", + "//internal/reexec", + ], +) diff --git a/cmd/evm/internal/compiler/BUILD.bazel b/cmd/evm/internal/compiler/BUILD.bazel new file mode 100644 index 000000000000..c380474ceaf2 --- /dev/null +++ b/cmd/evm/internal/compiler/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "compiler", + srcs = ["compiler.go"], + importpath = "github.com/ava-labs/libevm/cmd/evm/internal/compiler", + visibility = ["//cmd/evm:__subpackages__"], + deps = ["//core/asm"], +) diff --git a/cmd/evm/internal/t8ntool/BUILD.bazel b/cmd/evm/internal/t8ntool/BUILD.bazel new file mode 100644 index 000000000000..32a1f32f7cbb --- /dev/null +++ b/cmd/evm/internal/t8ntool/BUILD.bazel @@ -0,0 +1,47 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "t8ntool", + srcs = [ + "block.go", + "execution.go", + "flags.go", + "gen_header.go", + "gen_stenv.go", + "tracewriter.go", + "transaction.go", + "transition.go", + "tx_iterator.go", + "utils.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/evm/internal/t8ntool", + visibility = ["//cmd/evm:__subpackages__"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//consensus/clique", + "//consensus/ethash", + "//consensus/misc", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//eth/tracers", + "//eth/tracers/logger", + "//ethdb", + "//log", + "//params", + "//rlp", + "//tests", + "//trie", + "//triedb", + "@com_github_holiman_uint256//:uint256", + "@com_github_urfave_cli_v2//:cli", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/cmd/geth/BUILD.bazel b/cmd/geth/BUILD.bazel new file mode 100644 index 000000000000..b4f40bbd7116 --- /dev/null +++ b/cmd/geth/BUILD.bazel @@ -0,0 +1,94 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "geth_lib", + srcs = [ + "accountcmd.go", + "chaincmd.go", + "config.go", + "consolecmd.go", + "dbcmd.go", + "logtestcmd_inactive.go", + "main.go", + "misccmd.go", + "snapshot.go", + "verkle.go", + "version_check.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/geth", + visibility = ["//visibility:private"], + deps = [ + "//accounts", + "//accounts/external", + "//accounts/keystore", + "//accounts/scwallet", + "//accounts/usbwallet", + "//cmd/utils", + "//common", + "//common/hexutil", + "//console", + "//console/prompt", + "//core", + "//core/rawdb", + "//core/state", + "//core/state/pruner", + "//core/state/snapshot", + "//core/types", + "//crypto", + "//eth", + "//eth/catalyst", + "//eth/downloader", + "//eth/ethconfig", + "//eth/tracers/js", + "//eth/tracers/native", + "//ethclient", + "//ethdb", + "//internal/debug", + "//internal/era", + "//internal/ethapi", + "//internal/flags", + "//internal/version", + "//log", + "//metrics", + "//node", + "//params", + "//rlp", + "//trie", + "@com_github_gballet_go_verkle//:go-verkle", + "@com_github_jedisct1_go_minisign//:go-minisign", + "@com_github_naoina_toml//:toml", + "@com_github_olekukonko_tablewriter//:tablewriter", + "@com_github_urfave_cli_v2//:cli", + "@org_uber_go_automaxprocs//maxprocs", + ], +) + +go_binary( + name = "geth", + embed = [":geth_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "geth_test", + srcs = [ + "accountcmd_test.go", + "attach_test.go", + "consolecmd_test.go", + "exportcmd_test.go", + "genesis_test.go", + "run_test.go", + "version_check_test.go", + ], + data = glob(["testdata/**"]), + embed = [":geth_lib"], + deps = [ + "//common", + "//internal/cmdtest", + "//internal/reexec", + "//params", + "//rpc", + "@com_github_cespare_cp//:cp", + "@com_github_jedisct1_go_minisign//:go-minisign", + ], +) diff --git a/cmd/p2psim/BUILD.bazel b/cmd/p2psim/BUILD.bazel new file mode 100644 index 000000000000..3b7c60a97b08 --- /dev/null +++ b/cmd/p2psim/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "p2psim_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/p2psim", + visibility = ["//visibility:private"], + deps = [ + "//crypto", + "//internal/flags", + "//p2p", + "//p2p/enode", + "//p2p/simulations", + "//p2p/simulations/adapters", + "//rpc", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_binary( + name = "p2psim", + embed = [":p2psim_lib"], + visibility = ["//visibility:public"], +) diff --git a/cmd/rlpdump/BUILD.bazel b/cmd/rlpdump/BUILD.bazel new file mode 100644 index 000000000000..d02f0f928bf2 --- /dev/null +++ b/cmd/rlpdump/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "rlpdump_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/cmd/rlpdump", + visibility = ["//visibility:private"], + deps = [ + "//common", + "//rlp", + ], +) + +go_binary( + name = "rlpdump", + embed = [":rlpdump_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "rlpdump_test", + srcs = ["rlpdump_test.go"], + embed = [":rlpdump_lib"], + deps = [ + "//common", + "//common/hexutil", + ], +) diff --git a/cmd/utils/BUILD.bazel b/cmd/utils/BUILD.bazel new file mode 100644 index 000000000000..b4c025d2665d --- /dev/null +++ b/cmd/utils/BUILD.bazel @@ -0,0 +1,140 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utils", + srcs = [ + "cmd.go", + "diskusage.go", + "diskusage_openbsd.go", + "diskusage_windows.go", + "flags.go", + "flags_legacy.go", + "prompt.go", + ], + importpath = "github.com/ava-labs/libevm/cmd/utils", + visibility = ["//visibility:public"], + deps = [ + "//accounts", + "//accounts/keystore", + "//common", + "//common/fdlimit", + "//console/prompt", + "//core", + "//core/rawdb", + "//core/state/snapshot", + "//core/txpool/legacypool", + "//core/types", + "//core/vm", + "//crypto", + "//crypto/kzg4844", + "//eth", + "//eth/catalyst", + "//eth/downloader", + "//eth/ethconfig", + "//eth/filters", + "//eth/gasprice", + "//eth/tracers", + "//ethdb", + "//ethdb/remotedb", + "//ethstats", + "//graphql", + "//internal/debug", + "//internal/era", + "//internal/ethapi", + "//internal/flags", + "//log", + "//metrics", + "//metrics/exp", + "//metrics/influxdb", + "//miner", + "//node", + "//p2p", + "//p2p/enode", + "//p2p/nat", + "//p2p/netutil", + "//params", + "//rlp", + "//rpc", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_gballet_go_libpcsclite//:go-libpcsclite", + "@com_github_shirou_gopsutil//mem", + "@com_github_urfave_cli_v2//:cli", + ] + select({ + "@rules_go//go/platform:aix": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:darwin": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:dragonfly": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:freebsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:illumos": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:ios": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:js": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:netbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:openbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:osx": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:plan9": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:qnx": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:solaris": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "utils_test", + srcs = [ + "export_test.go", + "flags_test.go", + "history_test.go", + "prompt_test.go", + ], + embed = [":utils"], + deps = [ + "//common", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//internal/era", + "//params", + "//rlp", + "//trie", + "//triedb", + ], +) diff --git a/common/BUILD.bazel b/common/BUILD.bazel new file mode 100644 index 000000000000..e230c77153fc --- /dev/null +++ b/common/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "common", + srcs = [ + "big.go", + "bytes.go", + "debug.go", + "format.go", + "path.go", + "pointer.libevm.go", + "size.go", + "test_utils.go", + "types.go", + ], + importpath = "github.com/ava-labs/libevm/common", + visibility = ["//visibility:public"], + deps = [ + "//common/hexutil", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "common_test", + srcs = [ + "bytes_test.go", + "size_test.go", + "types_test.go", + ], + embed = [":common"], +) diff --git a/common/bitutil/BUILD.bazel b/common/bitutil/BUILD.bazel new file mode 100644 index 000000000000..593787729d0b --- /dev/null +++ b/common/bitutil/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bitutil", + srcs = [ + "bitutil.go", + "compress.go", + ], + importpath = "github.com/ava-labs/libevm/common/bitutil", + visibility = ["//visibility:public"], +) + +go_test( + name = "bitutil_test", + srcs = [ + "bitutil_test.go", + "compress_test.go", + ], + embed = [":bitutil"], + deps = ["//common/hexutil"], +) diff --git a/common/compiler/BUILD.bazel b/common/compiler/BUILD.bazel new file mode 100644 index 000000000000..eb0ab503252f --- /dev/null +++ b/common/compiler/BUILD.bazel @@ -0,0 +1,11 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "compiler", + srcs = [ + "helpers.go", + "solidity.go", + ], + importpath = "github.com/ava-labs/libevm/common/compiler", + visibility = ["//visibility:public"], +) diff --git a/common/fdlimit/BUILD.bazel b/common/fdlimit/BUILD.bazel new file mode 100644 index 000000000000..112bfebaed21 --- /dev/null +++ b/common/fdlimit/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fdlimit", + srcs = [ + "fdlimit_bsd.go", + "fdlimit_darwin.go", + "fdlimit_unix.go", + "fdlimit_windows.go", + ], + importpath = "github.com/ava-labs/libevm/common/fdlimit", + visibility = ["//visibility:public"], +) + +go_test( + name = "fdlimit_test", + srcs = ["fdlimit_test.go"], + embed = [":fdlimit"], +) diff --git a/common/hexutil/BUILD.bazel b/common/hexutil/BUILD.bazel new file mode 100644 index 000000000000..a69c85f5417c --- /dev/null +++ b/common/hexutil/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hexutil", + srcs = [ + "hexutil.go", + "json.go", + ], + importpath = "github.com/ava-labs/libevm/common/hexutil", + visibility = ["//visibility:public"], + deps = ["@com_github_holiman_uint256//:uint256"], +) + +go_test( + name = "hexutil_test", + srcs = [ + "hexutil_test.go", + "json_example_test.go", + "json_test.go", + ], + embed = [":hexutil"], + deps = ["@com_github_holiman_uint256//:uint256"], +) diff --git a/common/lru/BUILD.bazel b/common/lru/BUILD.bazel new file mode 100644 index 000000000000..1d10fcf72b1d --- /dev/null +++ b/common/lru/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lru", + srcs = [ + "basiclru.go", + "blob_lru.go", + "lru.go", + ], + importpath = "github.com/ava-labs/libevm/common/lru", + visibility = ["//visibility:public"], +) + +go_test( + name = "lru_test", + srcs = [ + "basiclru_test.go", + "blob_lru_test.go", + ], + embed = [":lru"], +) diff --git a/common/math/BUILD.bazel b/common/math/BUILD.bazel new file mode 100644 index 000000000000..4dfdd255a2da --- /dev/null +++ b/common/math/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "math", + srcs = [ + "big.go", + "integer.go", + ], + importpath = "github.com/ava-labs/libevm/common/math", + visibility = ["//visibility:public"], +) + +go_test( + name = "math_test", + srcs = [ + "big_test.go", + "integer_test.go", + ], + embed = [":math"], + deps = ["//common"], +) diff --git a/common/mclock/BUILD.bazel b/common/mclock/BUILD.bazel new file mode 100644 index 000000000000..d9b617af9d74 --- /dev/null +++ b/common/mclock/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "mclock", + srcs = [ + "alarm.go", + "mclock.go", + "mclock.s", + "simclock.go", + ], + importpath = "github.com/ava-labs/libevm/common/mclock", + visibility = ["//visibility:public"], +) + +go_test( + name = "mclock_test", + srcs = [ + "alarm_test.go", + "simclock_test.go", + ], + embed = [":mclock"], +) diff --git a/common/prque/BUILD.bazel b/common/prque/BUILD.bazel new file mode 100644 index 000000000000..3fd114fe79ab --- /dev/null +++ b/common/prque/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "prque", + srcs = [ + "lazyqueue.go", + "prque.go", + "sstack.go", + ], + importpath = "github.com/ava-labs/libevm/common/prque", + visibility = ["//visibility:public"], + deps = [ + "//common/mclock", + "@org_golang_x_exp//constraints", + ], +) + +go_test( + name = "prque_test", + srcs = [ + "lazyqueue_test.go", + "prque_test.go", + "sstack_test.go", + ], + embed = [":prque"], + deps = ["//common/mclock"], +) diff --git a/consensus/BUILD.bazel b/consensus/BUILD.bazel new file mode 100644 index 000000000000..8737564bd240 --- /dev/null +++ b/consensus/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "consensus", + srcs = [ + "consensus.go", + "errors.go", + "merger.go", + ], + importpath = "github.com/ava-labs/libevm/consensus", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/rawdb", + "//core/state", + "//core/types", + "//ethdb", + "//log", + "//params", + "//rlp", + "//rpc", + ], +) diff --git a/consensus/beacon/BUILD.bazel b/consensus/beacon/BUILD.bazel new file mode 100644 index 000000000000..b09b7c0e2b0c --- /dev/null +++ b/consensus/beacon/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "beacon", + srcs = [ + "consensus.go", + "faker.go", + ], + importpath = "github.com/ava-labs/libevm/consensus/beacon", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//consensus", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core/state", + "//core/types", + "//params", + "//rpc", + "//trie", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/consensus/clique/BUILD.bazel b/consensus/clique/BUILD.bazel new file mode 100644 index 000000000000..7dd019177733 --- /dev/null +++ b/consensus/clique/BUILD.bazel @@ -0,0 +1,52 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "clique", + srcs = [ + "api.go", + "clique.go", + "snapshot.go", + ], + importpath = "github.com/ava-labs/libevm/consensus/clique", + visibility = ["//visibility:public"], + deps = [ + "//accounts", + "//common", + "//common/hexutil", + "//common/lru", + "//consensus", + "//consensus/misc", + "//consensus/misc/eip1559", + "//core/rawdb", + "//core/state", + "//core/types", + "//crypto", + "//ethdb", + "//log", + "//params", + "//rlp", + "//rpc", + "//trie", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "clique_test", + srcs = [ + "clique_test.go", + "snapshot_test.go", + ], + embed = [":clique"], + deps = [ + "//common", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//params", + "@org_golang_x_exp//slices", + ], +) diff --git a/consensus/ethash/BUILD.bazel b/consensus/ethash/BUILD.bazel new file mode 100644 index 000000000000..26a1f5012be3 --- /dev/null +++ b/consensus/ethash/BUILD.bazel @@ -0,0 +1,40 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ethash", + srcs = [ + "consensus.go", + "difficulty.go", + "ethash.go", + ], + importpath = "github.com/ava-labs/libevm/consensus/ethash", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//consensus", + "//consensus/misc", + "//consensus/misc/eip1559", + "//core/state", + "//core/types", + "//params", + "//rlp", + "//rpc", + "//trie", + "@com_github_deckarep_golang_set_v2//:golang-set", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "ethash_test", + srcs = ["consensus_test.go"], + embed = [":ethash"], + deps = [ + "//common", + "//common/math", + "//core/types", + "//params", + ], +) diff --git a/consensus/misc/BUILD.bazel b/consensus/misc/BUILD.bazel new file mode 100644 index 000000000000..c6320c5acf8b --- /dev/null +++ b/consensus/misc/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "misc", + srcs = [ + "dao.go", + "gaslimit.go", + ], + importpath = "github.com/ava-labs/libevm/consensus/misc", + visibility = ["//visibility:public"], + deps = [ + "//core/state", + "//core/types", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/consensus/misc/eip1559/BUILD.bazel b/consensus/misc/eip1559/BUILD.bazel new file mode 100644 index 000000000000..be9f824e59fa --- /dev/null +++ b/consensus/misc/eip1559/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "eip1559", + srcs = ["eip1559.go"], + importpath = "github.com/ava-labs/libevm/consensus/misc/eip1559", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//consensus/misc", + "//core/types", + "//params", + ], +) + +go_test( + name = "eip1559_test", + srcs = ["eip1559_test.go"], + embed = [":eip1559"], + deps = [ + "//common", + "//core/types", + "//params", + ], +) diff --git a/consensus/misc/eip4844/BUILD.bazel b/consensus/misc/eip4844/BUILD.bazel new file mode 100644 index 000000000000..889d706b611a --- /dev/null +++ b/consensus/misc/eip4844/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "eip4844", + srcs = ["eip4844.go"], + importpath = "github.com/ava-labs/libevm/consensus/misc/eip4844", + visibility = ["//visibility:public"], + deps = [ + "//core/types", + "//params", + ], +) + +go_test( + name = "eip4844_test", + srcs = ["eip4844_test.go"], + embed = [":eip4844"], + deps = ["//params"], +) diff --git a/console/BUILD.bazel b/console/BUILD.bazel new file mode 100644 index 000000000000..9eeac1eaa61f --- /dev/null +++ b/console/BUILD.bazel @@ -0,0 +1,46 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "console", + srcs = [ + "bridge.go", + "console.go", + ], + importpath = "github.com/ava-labs/libevm/console", + visibility = ["//visibility:public"], + deps = [ + "//accounts/scwallet", + "//accounts/usbwallet", + "//common/hexutil", + "//console/prompt", + "//internal/jsre", + "//internal/jsre/deps", + "//internal/web3ext", + "//log", + "//rpc", + "@com_github_dop251_goja//:goja", + "@com_github_mattn_go_colorable//:go-colorable", + "@com_github_peterh_liner//:liner", + ], +) + +go_test( + name = "console_test", + srcs = [ + "bridge_test.go", + "console_test.go", + ], + data = glob(["testdata/**"]), + embed = [":console"], + deps = [ + "//common", + "//console/prompt", + "//core", + "//eth", + "//eth/ethconfig", + "//internal/jsre", + "//miner", + "//node", + "@com_github_dop251_goja//:goja", + ], +) diff --git a/console/prompt/BUILD.bazel b/console/prompt/BUILD.bazel new file mode 100644 index 000000000000..79043016b5a3 --- /dev/null +++ b/console/prompt/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "prompt", + srcs = ["prompter.go"], + importpath = "github.com/ava-labs/libevm/console/prompt", + visibility = ["//visibility:public"], + deps = ["@com_github_peterh_liner//:liner"], +) diff --git a/core/BUILD.bazel b/core/BUILD.bazel new file mode 100644 index 000000000000..e23b5635ca47 --- /dev/null +++ b/core/BUILD.bazel @@ -0,0 +1,121 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "core", + srcs = [ + "block_validator.go", + "blockchain.go", + "blockchain_insert.go", + "blockchain_reader.go", + "blocks.go", + "bloom_indexer.go", + "chain_indexer.go", + "chain_makers.go", + "error.go", + "events.go", + "evm.go", + "forkchoice.go", + "gaspool.go", + "gen_genesis.go", + "genesis.go", + "genesis_alloc.go", + "headerchain.go", + "sender_cacher.go", + "state_prefetcher.go", + "state_processor.go", + "state_transition.go", + "state_transition.libevm.go", + "txindexer.go", + "types.go", + ], + importpath = "github.com/ava-labs/libevm/core", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/bitutil", + "//common/hexutil", + "//common/lru", + "//common/math", + "//common/mclock", + "//common/prque", + "//consensus", + "//consensus/misc", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core/bloombits", + "//core/rawdb", + "//core/state", + "//core/state/snapshot", + "//core/types", + "//core/vm", + "//crypto", + "//crypto/kzg4844", + "//ethdb", + "//event", + "//internal/syncx", + "//internal/version", + "//log", + "//metrics", + "//params", + "//rlp", + "//trie", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "core_test", + timeout = "long", + srcs = [ + "bench_test.go", + "block_validator_test.go", + "blockchain_repair_test.go", + "blockchain_sethead_test.go", + "blockchain_snapshot_test.go", + "blockchain_test.go", + "chain_indexer_test.go", + "chain_makers_test.go", + "dao_test.go", + "genesis_test.go", + "headerchain_test.go", + "rlp_test.go", + "state_processor_test.go", + "state_transition.libevm_test.go", + "txindexer_test.go", + ], + embed = [":core"], + deps = [ + "//common", + "//common/math", + "//consensus", + "//consensus/beacon", + "//consensus/clique", + "//consensus/ethash", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//eth/tracers/logger", + "//ethdb", + "//libevm", + "//libevm/ethtest", + "//libevm/hookstest", + "//params", + "//rlp", + "//trie", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_davecgh_go_spew//spew", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//require", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/core/asm/BUILD.bazel b/core/asm/BUILD.bazel new file mode 100644 index 000000000000..8cdbff6dae07 --- /dev/null +++ b/core/asm/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "asm", + srcs = [ + "asm.go", + "compiler.go", + "lexer.go", + "tokentype_string.go", + ], + importpath = "github.com/ava-labs/libevm/core/asm", + visibility = ["//visibility:public"], + deps = [ + "//common/math", + "//core/vm", + ], +) + +go_test( + name = "asm_test", + srcs = [ + "asm_test.go", + "compiler_test.go", + "lex_test.go", + ], + embed = [":asm"], +) diff --git a/core/bloombits/BUILD.bazel b/core/bloombits/BUILD.bazel new file mode 100644 index 000000000000..8e9c49909f45 --- /dev/null +++ b/core/bloombits/BUILD.bazel @@ -0,0 +1,32 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bloombits", + srcs = [ + "doc.go", + "generator.go", + "matcher.go", + "scheduler.go", + ], + importpath = "github.com/ava-labs/libevm/core/bloombits", + visibility = ["//visibility:public"], + deps = [ + "//common/bitutil", + "//core/types", + "//crypto", + ], +) + +go_test( + name = "bloombits_test", + srcs = [ + "generator_test.go", + "matcher_test.go", + "scheduler_test.go", + ], + embed = [":bloombits"], + deps = [ + "//common", + "//core/types", + ], +) diff --git a/core/forkid/BUILD.bazel b/core/forkid/BUILD.bazel new file mode 100644 index 000000000000..81cc042b9006 --- /dev/null +++ b/core/forkid/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "forkid", + srcs = ["forkid.go"], + importpath = "github.com/ava-labs/libevm/core/forkid", + visibility = ["//visibility:public"], + deps = [ + "//core/types", + "//log", + "//params", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "forkid_test", + srcs = ["forkid_test.go"], + embed = [":forkid"], + deps = [ + "//common", + "//core", + "//core/types", + "//params", + "//rlp", + ], +) diff --git a/core/rawdb/BUILD.bazel b/core/rawdb/BUILD.bazel new file mode 100644 index 000000000000..ce169b792b65 --- /dev/null +++ b/core/rawdb/BUILD.bazel @@ -0,0 +1,86 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rawdb", + srcs = [ + "accessors_chain.go", + "accessors_indexes.go", + "accessors_metadata.go", + "accessors_snapshot.go", + "accessors_state.go", + "accessors_sync.go", + "accessors_trie.go", + "ancient_scheme.go", + "ancient_utils.go", + "chain_freezer.go", + "chain_iterator.go", + "database.go", + "database.libevm.go", + "freezer.go", + "freezer_batch.go", + "freezer_meta.go", + "freezer_resettable.go", + "freezer_table.go", + "freezer_utils.go", + "key_length_iterator.go", + "schema.go", + "table.go", + ], + importpath = "github.com/ava-labs/libevm/core/rawdb", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//common/prque", + "//consensus/misc/eip4844", + "//core/types", + "//crypto", + "//ethdb", + "//ethdb/leveldb", + "//ethdb/memorydb", + "//ethdb/pebble", + "//libevm/options", + "//log", + "//metrics", + "//params", + "//rlp", + "@com_github_gofrs_flock//:flock", + "@com_github_golang_snappy//:snappy", + "@com_github_olekukonko_tablewriter//:tablewriter", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "rawdb_test", + srcs = [ + "accessors_chain_test.go", + "accessors_indexes_test.go", + "chain_iterator_test.go", + "database.libevm_test.go", + "database_test.go", + "freezer_meta_test.go", + "freezer_resettable_test.go", + "freezer_table_test.go", + "freezer_test.go", + "freezer_utils_test.go", + "key_length_iterator_test.go", + "table_test.go", + ], + data = glob(["testdata/**"]), + embed = [":rawdb"], + deps = [ + "//common", + "//core/types", + "//crypto", + "//ethdb", + "//internal/blocktest", + "//metrics", + "//params", + "//rlp", + "@com_github_davecgh_go_spew//spew", + "@com_github_stretchr_testify//require", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/core/state/BUILD.bazel b/core/state/BUILD.bazel new file mode 100644 index 000000000000..928351c23850 --- /dev/null +++ b/core/state/BUILD.bazel @@ -0,0 +1,88 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "state", + srcs = [ + "access_list.go", + "database.go", + "dump.go", + "iterator.go", + "journal.go", + "metrics.go", + "state.libevm.go", + "state_object.go", + "statedb.go", + "statedb.libevm.go", + "sync.go", + "transient_storage.go", + "trie_prefetcher.go", + "trie_prefetcher.libevm.go", + ], + importpath = "github.com/ava-labs/libevm/core/state", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//common/lru", + "//core/rawdb", + "//core/state/snapshot", + "//core/types", + "//crypto", + "//ethdb", + "//libevm/options", + "//libevm/pseudo", + "//libevm/stateconf", + "//libevm/sync", + "//log", + "//metrics", + "//params", + "//rlp", + "//trie", + "//trie/trienode", + "//trie/triestate", + "//trie/utils", + "//triedb", + "@com_github_crate_crypto_go_ipa//banderwagon", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "state_test", + srcs = [ + "iterator_test.go", + "state.libevm_test.go", + "state_object.libevm_test.go", + "state_object_test.go", + "state_test.go", + "statedb.libevm_test.go", + "statedb_fuzz_test.go", + "statedb_test.go", + "sync_test.go", + "trie_prefetcher.libevm_test.go", + "trie_prefetcher_test.go", + ], + embed = [":state"], + deps = [ + "//common", + "//core/rawdb", + "//core/state/snapshot", + "//core/types", + "//crypto", + "//ethdb", + "//ethdb/memorydb", + "//libevm/ethtest", + "//libevm/stateconf", + "//rlp", + "//trie", + "//trie/trienode", + "//trie/triestate", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_google_go_cmp//cmp", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/core/state/pruner/BUILD.bazel b/core/state/pruner/BUILD.bazel new file mode 100644 index 000000000000..f32228d88ac4 --- /dev/null +++ b/core/state/pruner/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "pruner", + srcs = [ + "bloom.go", + "pruner.go", + ], + importpath = "github.com/ava-labs/libevm/core/state/pruner", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/rawdb", + "//core/state/snapshot", + "//core/types", + "//ethdb", + "//log", + "//rlp", + "//trie", + "//triedb", + "@com_github_holiman_bloomfilter_v2//:bloomfilter", + ], +) diff --git a/core/state/snapshot/BUILD.bazel b/core/state/snapshot/BUILD.bazel new file mode 100644 index 000000000000..adce7b8c7faf --- /dev/null +++ b/core/state/snapshot/BUILD.bazel @@ -0,0 +1,72 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "snapshot", + srcs = [ + "context.go", + "conversion.go", + "difflayer.go", + "disklayer.go", + "generate.go", + "holdable_iterator.go", + "iterator.go", + "iterator_binary.go", + "iterator_fast.go", + "journal.go", + "metrics.go", + "snapshot.go", + "utils.go", + ], + importpath = "github.com/ava-labs/libevm/core/state/snapshot", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core/rawdb", + "//core/types", + "//ethdb", + "//ethdb/memorydb", + "//libevm/stateconf", + "//log", + "//metrics", + "//rlp", + "//trie", + "//trie/trienode", + "//triedb", + "@com_github_holiman_bloomfilter_v2//:bloomfilter", + "@com_github_victoriametrics_fastcache//:fastcache", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "snapshot_test", + srcs = [ + "difflayer_test.go", + "disklayer_test.go", + "generate_test.go", + "holdable_iterator_test.go", + "iterator_test.go", + "snapshot_test.go", + ], + embed = [":snapshot"], + deps = [ + "//common", + "//core/rawdb", + "//core/types", + "//crypto", + "//ethdb", + "//ethdb/memorydb", + "//log", + "//rlp", + "//trie", + "//trie/trienode", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_holiman_uint256//:uint256", + "@com_github_victoriametrics_fastcache//:fastcache", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/core/txpool/BUILD.bazel b/core/txpool/BUILD.bazel new file mode 100644 index 000000000000..5343371ad955 --- /dev/null +++ b/core/txpool/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "txpool", + srcs = [ + "errors.go", + "subpool.go", + "txpool.go", + "validation.go", + ], + importpath = "github.com/ava-labs/libevm/core/txpool", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core", + "//core/state", + "//core/types", + "//crypto/kzg4844", + "//event", + "//log", + "//metrics", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/core/txpool/blobpool/BUILD.bazel b/core/txpool/blobpool/BUILD.bazel new file mode 100644 index 000000000000..ca693bea03a3 --- /dev/null +++ b/core/txpool/blobpool/BUILD.bazel @@ -0,0 +1,62 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "blobpool", + srcs = [ + "blobpool.go", + "config.go", + "evictheap.go", + "interface.go", + "limbo.go", + "metrics.go", + "priority.go", + "slotter.go", + ], + importpath = "github.com/ava-labs/libevm/core/txpool/blobpool", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core", + "//core/state", + "//core/txpool", + "//core/types", + "//event", + "//log", + "//metrics", + "//params", + "//rlp", + "@com_github_holiman_billy//:billy", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "blobpool_test", + srcs = [ + "blobpool_test.go", + "evictheap_test.go", + "priority_test.go", + "slotter_test.go", + ], + embed = [":blobpool"], + deps = [ + "//common", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core", + "//core/rawdb", + "//core/state", + "//core/txpool", + "//core/types", + "//crypto", + "//crypto/kzg4844", + "//ethdb/memorydb", + "//log", + "//params", + "//rlp", + "@com_github_holiman_billy//:billy", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/core/txpool/legacypool/BUILD.bazel b/core/txpool/legacypool/BUILD.bazel new file mode 100644 index 000000000000..bcc5483138e9 --- /dev/null +++ b/core/txpool/legacypool/BUILD.bazel @@ -0,0 +1,52 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "legacypool", + srcs = [ + "journal.go", + "legacypool.go", + "list.go", + "noncer.go", + ], + importpath = "github.com/ava-labs/libevm/core/txpool/legacypool", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/prque", + "//consensus/misc/eip1559", + "//core", + "//core/state", + "//core/txpool", + "//core/types", + "//event", + "//log", + "//metrics", + "//params", + "//rlp", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "legacypool_test", + srcs = [ + "legacypool2_test.go", + "legacypool_test.go", + "list_test.go", + ], + embed = [":legacypool"], + deps = [ + "//common", + "//core", + "//core/rawdb", + "//core/state", + "//core/txpool", + "//core/types", + "//crypto", + "//event", + "//params", + "//trie", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/core/types/BUILD.bazel b/core/types/BUILD.bazel new file mode 100644 index 000000000000..bba82f983233 --- /dev/null +++ b/core/types/BUILD.bazel @@ -0,0 +1,98 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "types", + srcs = [ + "account.go", + "block.go", + "block.libevm.go", + "bloom9.go", + "gen_access_tuple.go", + "gen_account.go", + "gen_account_rlp.go", + "gen_header_json.go", + "gen_header_rlp.go", + "gen_log_json.go", + "gen_log_rlp.go", + "gen_receipt_json.go", + "gen_slim_account_rlp.libevm.go", + "gen_withdrawal_json.go", + "gen_withdrawal_rlp.go", + "hashes.go", + "hashing.go", + "log.go", + "receipt.go", + "rlp_payload.libevm.go", + "state_account.go", + "transaction.go", + "transaction_marshalling.go", + "transaction_signing.go", + "tx_access_list.go", + "tx_blob.go", + "tx_dynamic_fee.go", + "tx_legacy.go", + "withdrawal.go", + ], + importpath = "github.com/ava-labs/libevm/core/types", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//crypto", + "//crypto/kzg4844", + "//libevm/pseudo", + "//libevm/register", + "//libevm/testonly", + "//log", + "//params", + "//rlp", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "types_test", + srcs = [ + "backwards_compat.libevm_test.go", + "backwards_compat_diffpkg.libevm_test.go", + "block.libevm_test.go", + "block_test.go", + "bloom9_test.go", + "hashing_test.go", + "log_test.go", + "receipt_test.go", + "rlp_fuzzer_test.go", + "state_account.libevm_test.go", + "state_account_storage.libevm_test.go", + "transaction_signing_test.go", + "transaction_test.go", + "tx_blob_test.go", + "types_test.go", + ], + embed = [":types"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core/rawdb", + "//crypto", + "//crypto/kzg4844", + "//internal/blocktest", + "//libevm/ethtest", + "//libevm/pseudo", + "//params", + "//rlp", + "//trie", + "//triedb", + "@com_github_davecgh_go_spew//spew", + "@com_github_google_go_cmp//cmp", + "@com_github_google_go_cmp//cmp/cmpopts", + "@com_github_holiman_uint256//:uint256", + "@com_github_kr_pretty//:pretty", + "@com_github_kylelemons_godebug//diff", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/core/vm/BUILD.bazel b/core/vm/BUILD.bazel new file mode 100644 index 000000000000..854517a9cc61 --- /dev/null +++ b/core/vm/BUILD.bazel @@ -0,0 +1,96 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "vm", + srcs = [ + "analysis.go", + "common.go", + "contract.go", + "contracts.go", + "contracts.libevm.go", + "doc.go", + "eips.go", + "environment.libevm.go", + "errors.go", + "evm.go", + "evm.libevm.go", + "gas.go", + "gas_table.go", + "hooks.libevm.go", + "instructions.go", + "interface.go", + "interpreter.go", + "jump_table.go", + "jump_table_export.go", + "logger.go", + "memory.go", + "memory_table.go", + "opcodes.go", + "operations_acl.go", + "options.libevm.go", + "stack.go", + "stack.libevm.go", + "stack_table.go", + ], + importpath = "github.com/ava-labs/libevm/core/vm", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//core/types", + "//crypto", + "//crypto/blake2b", + "//crypto/bls12381", + "//crypto/bn256", + "//crypto/kzg4844", + "//libevm", + "//libevm/options", + "//libevm/set", + "//log", + "//params", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//ripemd160", + "@org_golang_x_exp//slog", + ], +) + +go_test( + name = "vm_test", + srcs = [ + "analysis_test.go", + "contracts.libevm_test.go", + "contracts_fuzz_test.go", + "contracts_test.go", + "evm.libevm_test.go", + "gas_table_test.go", + "instructions_test.go", + "interpreter_test.go", + "jump_table_test.go", + "libevm_test.go", + "memory_test.go", + "stack.libevm_test.go", + ], + data = glob(["testdata/**"]), + embed = [":vm"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//crypto", + "//eth/tracers", + "//eth/tracers/native", + "//libevm", + "//libevm/ethtest", + "//libevm/hookstest", + "//libevm/legacy", + "//params", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@org_golang_x_exp//rand", + ], +) diff --git a/core/vm/runtime/BUILD.bazel b/core/vm/runtime/BUILD.bazel new file mode 100644 index 000000000000..4f0f990a2d08 --- /dev/null +++ b/core/vm/runtime/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "runtime", + srcs = [ + "doc.go", + "env.go", + "runtime.go", + ], + importpath = "github.com/ava-labs/libevm/core/vm/runtime", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "runtime_test", + srcs = [ + "runtime_example_test.go", + "runtime_fuzz_test.go", + "runtime_test.go", + ], + embed = [":runtime"], + deps = [ + "//accounts/abi", + "//common", + "//consensus", + "//core", + "//core/asm", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//eth/tracers", + "//eth/tracers/js", + "//eth/tracers/logger", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/crypto/BUILD.bazel b/crypto/BUILD.bazel new file mode 100644 index 000000000000..0a5094a5ef90 --- /dev/null +++ b/crypto/BUILD.bazel @@ -0,0 +1,113 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "crypto", + srcs = [ + "crypto.go", + "signature_cgo.go", + "signature_nocgo.go", + ], + importpath = "github.com/ava-labs/libevm/crypto", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//rlp", + "@org_golang_x_crypto//sha3", + ] + select({ + "@rules_go//go/platform:aix": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:android": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:darwin": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:dragonfly": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:freebsd": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:illumos": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:ios": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:js": [ + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:linux": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:netbsd": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:openbsd": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:osx": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:plan9": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:qnx": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:solaris": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "@rules_go//go/platform:windows": [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + "@com_github_btcsuite_btcd_btcec_v2//ecdsa", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "crypto_test", + srcs = [ + "crypto_test.go", + "signature_test.go", + ], + embed = [":crypto"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + ], +) diff --git a/crypto/blake2b/BUILD.bazel b/crypto/blake2b/BUILD.bazel new file mode 100644 index 000000000000..0b404afdaf05 --- /dev/null +++ b/crypto/blake2b/BUILD.bazel @@ -0,0 +1,34 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "blake2b", + srcs = [ + "blake2b.go", + "blake2bAVX2_amd64.go", + "blake2bAVX2_amd64.s", + "blake2b_amd64.go", + "blake2b_amd64.s", + "blake2b_generic.go", + "blake2b_ref.go", + "blake2x.go", + "register.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/blake2b", + visibility = ["//visibility:public"], + deps = select({ + "@rules_go//go/platform:amd64": [ + "@org_golang_x_sys//cpu", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "blake2b_test", + srcs = [ + "blake2b_f_fuzz_test.go", + "blake2b_f_test.go", + "blake2b_test.go", + ], + embed = [":blake2b"], +) diff --git a/crypto/bls12381/BUILD.bazel b/crypto/bls12381/BUILD.bazel new file mode 100644 index 000000000000..d8b03eaea191 --- /dev/null +++ b/crypto/bls12381/BUILD.bazel @@ -0,0 +1,38 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bls12381", + srcs = [ + "arithmetic_fallback.go", + "bls12_381.go", + "field_element.go", + "fp.go", + "fp12.go", + "fp2.go", + "fp6.go", + "g1.go", + "g2.go", + "gt.go", + "isogeny.go", + "pairing.go", + "swu.go", + "utils.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/bls12381", + visibility = ["//visibility:public"], + deps = ["//common"], +) + +go_test( + name = "bls12381_test", + srcs = [ + "bls12_381_test.go", + "field_element_test.go", + "fp_test.go", + "g1_test.go", + "g2_test.go", + "pairing_test.go", + ], + embed = [":bls12381"], + deps = ["//common"], +) diff --git a/crypto/bn256/BUILD.bazel b/crypto/bn256/BUILD.bazel new file mode 100644 index 000000000000..df9bfcf4d4e3 --- /dev/null +++ b/crypto/bn256/BUILD.bazel @@ -0,0 +1,53 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "bn256", + srcs = [ + "bn256_fast.go", + "bn256_slow.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/bn256", + visibility = ["//visibility:public"], + deps = select({ + "@rules_go//go/platform:386": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:amd64": [ + "//crypto/bn256/cloudflare", + ], + "@rules_go//go/platform:arm": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:arm64": [ + "//crypto/bn256/cloudflare", + ], + "@rules_go//go/platform:mips": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:mips64": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:mips64le": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:mipsle": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:ppc64": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:ppc64le": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:riscv64": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:s390x": [ + "//crypto/bn256/google", + ], + "@rules_go//go/platform:wasm": [ + "//crypto/bn256/google", + ], + "//conditions:default": [], + }), +) diff --git a/crypto/bn256/cloudflare/BUILD.bazel b/crypto/bn256/cloudflare/BUILD.bazel new file mode 100644 index 000000000000..c7bdc0da726b --- /dev/null +++ b/crypto/bn256/cloudflare/BUILD.bazel @@ -0,0 +1,48 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cloudflare", + srcs = [ + "bn256.go", + "constants.go", + "curve.go", + "gfp.go", + "gfp12.go", + "gfp2.go", + "gfp6.go", + "gfp_amd64.s", + "gfp_arm64.s", + "gfp_decl.go", + "gfp_generic.go", + "lattice.go", + "mul_amd64.h", + "mul_arm64.h", + "mul_bmi2_amd64.h", + "optate.go", + "twist.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/bn256/cloudflare", + visibility = ["//visibility:public"], + deps = select({ + "@rules_go//go/platform:amd64": [ + "@org_golang_x_sys//cpu", + ], + "@rules_go//go/platform:arm64": [ + "@org_golang_x_sys//cpu", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "cloudflare_test", + srcs = [ + "bn256_test.go", + "example_test.go", + "gfp_test.go", + "lattice_test.go", + "main_test.go", + ], + embed = [":cloudflare"], + deps = ["@com_github_stretchr_testify//require"], +) diff --git a/crypto/bn256/google/BUILD.bazel b/crypto/bn256/google/BUILD.bazel new file mode 100644 index 000000000000..1cf6a413899c --- /dev/null +++ b/crypto/bn256/google/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "google", + srcs = [ + "bn256.go", + "constants.go", + "curve.go", + "gfp12.go", + "gfp2.go", + "gfp6.go", + "optate.go", + "twist.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/bn256/google", + visibility = ["//visibility:public"], +) + +go_test( + name = "google_test", + srcs = [ + "bn256_test.go", + "example_test.go", + "main_test.go", + ], + embed = [":google"], +) diff --git a/crypto/ecies/BUILD.bazel b/crypto/ecies/BUILD.bazel new file mode 100644 index 000000000000..dfb2dfc6e9e4 --- /dev/null +++ b/crypto/ecies/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ecies", + srcs = [ + "ecies.go", + "params.go", + ], + importpath = "github.com/ava-labs/libevm/crypto/ecies", + visibility = ["//visibility:public"], + deps = ["//crypto"], +) + +go_test( + name = "ecies_test", + srcs = ["ecies_test.go"], + embed = [":ecies"], + deps = ["//crypto"], +) diff --git a/crypto/kzg4844/BUILD.bazel b/crypto/kzg4844/BUILD.bazel new file mode 100644 index 000000000000..558c082d5b46 --- /dev/null +++ b/crypto/kzg4844/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kzg4844", + srcs = [ + "kzg4844.go", + "kzg4844_ckzg_nocgo.go", + "kzg4844_gokzg.go", + ], + embedsrcs = ["trusted_setup.json"], + importpath = "github.com/ava-labs/libevm/crypto/kzg4844", + visibility = ["//visibility:public"], + deps = [ + "//common/hexutil", + "@com_github_crate_crypto_go_kzg_4844//:go-kzg-4844", + ], +) + +go_test( + name = "kzg4844_test", + srcs = ["kzg4844_test.go"], + embed = [":kzg4844"], + deps = [ + "@com_github_consensys_gnark_crypto//ecc/bls12-381/fr", + "@com_github_crate_crypto_go_kzg_4844//:go-kzg-4844", + ], +) diff --git a/crypto/secp256k1/BUILD.bazel b/crypto/secp256k1/BUILD.bazel new file mode 100644 index 000000000000..2bfb66165d5b --- /dev/null +++ b/crypto/secp256k1/BUILD.bazel @@ -0,0 +1,29 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "secp256k1", + srcs = [ + "curve.go", + "ext.h", + "panic_cb.go", + "scalar_mult_cgo.go", + "scalar_mult_nocgo.go", + "secp256.go", + ], + cdeps = [ + "//crypto/secp256k1/libsecp256k1", + ], + cgo = True, + copts = [ + "-Icrypto/secp256k1/libsecp256k1", + "-Icrypto/secp256k1/libsecp256k1/src", + ], + importpath = "github.com/ava-labs/libevm/crypto/secp256k1", + visibility = ["//visibility:public"], +) + +go_test( + name = "secp256k1_test", + srcs = ["secp256_test.go"], + embed = [":secp256k1"], +) diff --git a/crypto/secp256k1/libsecp256k1/BUILD.bazel b/crypto/secp256k1/libsecp256k1/BUILD.bazel new file mode 100644 index 000000000000..4240bc956768 --- /dev/null +++ b/crypto/secp256k1/libsecp256k1/BUILD.bazel @@ -0,0 +1,8 @@ +cc_library( + name = "libsecp256k1", + hdrs = glob([ + "**/*.c", + "**/*.h", + ]), + visibility = ["//crypto/secp256k1:__pkg__"], +) diff --git a/crypto/signify/BUILD.bazel b/crypto/signify/BUILD.bazel new file mode 100644 index 000000000000..bda22aa7896f --- /dev/null +++ b/crypto/signify/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "signify", + srcs = ["signify.go"], + importpath = "github.com/ava-labs/libevm/crypto/signify", + visibility = ["//visibility:public"], +) + +go_test( + name = "signify_test", + srcs = ["signify_test.go"], + embed = [":signify"], + deps = ["@com_github_jedisct1_go_minisign//:go-minisign"], +) diff --git a/eth/BUILD.bazel b/eth/BUILD.bazel new file mode 100644 index 000000000000..9a62ab24d618 --- /dev/null +++ b/eth/BUILD.bazel @@ -0,0 +1,105 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "eth", + srcs = [ + "api.go", + "api_admin.go", + "api_backend.go", + "api_debug.go", + "api_miner.go", + "backend.go", + "bloombits.go", + "handler.go", + "handler_eth.go", + "handler_snap.go", + "peer.go", + "peerset.go", + "state_accessor.go", + "sync.go", + ], + importpath = "github.com/ava-labs/libevm/eth", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//accounts", + "//common", + "//common/bitutil", + "//common/hexutil", + "//consensus", + "//consensus/beacon", + "//consensus/clique", + "//core", + "//core/bloombits", + "//core/forkid", + "//core/rawdb", + "//core/state", + "//core/state/pruner", + "//core/txpool", + "//core/txpool/blobpool", + "//core/txpool/legacypool", + "//core/types", + "//core/vm", + "//crypto", + "//eth/downloader", + "//eth/ethconfig", + "//eth/fetcher", + "//eth/gasprice", + "//eth/protocols/eth", + "//eth/protocols/snap", + "//eth/tracers", + "//ethdb", + "//event", + "//internal/ethapi", + "//internal/shutdowncheck", + "//log", + "//metrics", + "//miner", + "//node", + "//p2p", + "//p2p/dnsdisc", + "//p2p/enode", + "//params", + "//rlp", + "//rpc", + "//trie", + "//triedb", + "//triedb/pathdb", + ], +) + +go_test( + name = "eth_test", + srcs = [ + "api_debug_test.go", + "handler_eth_test.go", + "handler_test.go", + "sync_test.go", + ], + embed = [":eth"], + deps = [ + "//common", + "//consensus", + "//consensus/ethash", + "//core", + "//core/forkid", + "//core/rawdb", + "//core/state", + "//core/txpool", + "//core/types", + "//core/vm", + "//crypto", + "//eth/downloader", + "//eth/protocols/eth", + "//eth/protocols/snap", + "//ethdb", + "//event", + "//p2p", + "//p2p/enode", + "//params", + "//triedb", + "@com_github_davecgh_go_spew//spew", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_exp//slices", + ], +) diff --git a/eth/catalyst/BUILD.bazel b/eth/catalyst/BUILD.bazel new file mode 100644 index 000000000000..aeaa38450374 --- /dev/null +++ b/eth/catalyst/BUILD.bazel @@ -0,0 +1,64 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "catalyst", + srcs = [ + "api.go", + "queue.go", + "simulated_beacon.go", + "simulated_beacon_api.go", + "tester.go", + ], + importpath = "github.com/ava-labs/libevm/eth/catalyst", + visibility = ["//visibility:public"], + deps = [ + "//beacon/engine", + "//common", + "//common/hexutil", + "//core", + "//core/rawdb", + "//core/txpool", + "//core/types", + "//eth", + "//eth/downloader", + "//internal/version", + "//log", + "//miner", + "//node", + "//params", + "//params/forks", + "//rpc", + ], +) + +go_test( + name = "catalyst_test", + srcs = [ + "api_test.go", + "simulated_beacon_test.go", + ], + embed = [":catalyst"], + deps = [ + "//beacon/engine", + "//common", + "//common/hexutil", + "//consensus", + "//consensus/beacon", + "//consensus/ethash", + "//core", + "//core/types", + "//crypto", + "//crypto/kzg4844", + "//eth", + "//eth/downloader", + "//eth/ethconfig", + "//log", + "//miner", + "//node", + "//p2p", + "//params", + "//rpc", + "//trie", + "@com_github_mattn_go_colorable//:go-colorable", + ], +) diff --git a/eth/downloader/BUILD.bazel b/eth/downloader/BUILD.bazel new file mode 100644 index 000000000000..5018e53c5b13 --- /dev/null +++ b/eth/downloader/BUILD.bazel @@ -0,0 +1,76 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "downloader", + srcs = [ + "api.go", + "beacondevsync.go", + "beaconsync.go", + "downloader.go", + "events.go", + "fetchers.go", + "fetchers_concurrent.go", + "fetchers_concurrent_bodies.go", + "fetchers_concurrent_headers.go", + "fetchers_concurrent_receipts.go", + "metrics.go", + "modes.go", + "peer.go", + "queue.go", + "resultstore.go", + "skeleton.go", + "statesync.go", + ], + importpath = "github.com/ava-labs/libevm/eth/downloader", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/prque", + "//core", + "//core/rawdb", + "//core/state/snapshot", + "//core/types", + "//crypto/kzg4844", + "//eth/protocols/eth", + "//eth/protocols/snap", + "//ethdb", + "//event", + "//log", + "//metrics", + "//p2p/msgrate", + "//params", + "//rpc", + "//triedb", + ], +) + +go_test( + name = "downloader_test", + srcs = [ + "downloader_test.go", + "queue_test.go", + "skeleton_test.go", + "testchain_test.go", + ], + embed = [":downloader"], + deps = [ + "//:libevm", + "//common", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//eth/protocols/eth", + "//eth/protocols/snap", + "//event", + "//log", + "//params", + "//rlp", + "//trie", + "//triedb", + "@org_golang_x_exp//slog", + ], +) diff --git a/eth/ethconfig/BUILD.bazel b/eth/ethconfig/BUILD.bazel new file mode 100644 index 000000000000..6dbac1900cf3 --- /dev/null +++ b/eth/ethconfig/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "ethconfig", + srcs = [ + "config.go", + "gen_config.go", + ], + importpath = "github.com/ava-labs/libevm/eth/ethconfig", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//consensus", + "//consensus/beacon", + "//consensus/clique", + "//consensus/ethash", + "//core", + "//core/txpool/blobpool", + "//core/txpool/legacypool", + "//eth/downloader", + "//eth/gasprice", + "//ethdb", + "//miner", + "//params", + ], +) diff --git a/eth/fetcher/BUILD.bazel b/eth/fetcher/BUILD.bazel new file mode 100644 index 000000000000..10d0a45b1b1a --- /dev/null +++ b/eth/fetcher/BUILD.bazel @@ -0,0 +1,47 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fetcher", + srcs = [ + "block_fetcher.go", + "tx_fetcher.go", + ], + importpath = "github.com/ava-labs/libevm/eth/fetcher", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/lru", + "//common/mclock", + "//common/prque", + "//consensus", + "//core/txpool", + "//core/types", + "//eth/protocols/eth", + "//log", + "//metrics", + "//trie", + ], +) + +go_test( + name = "fetcher_test", + srcs = [ + "block_fetcher_test.go", + "tx_fetcher_test.go", + ], + embed = [":fetcher"], + deps = [ + "//common", + "//common/mclock", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/txpool", + "//core/types", + "//crypto", + "//eth/protocols/eth", + "//params", + "//trie", + "//triedb", + ], +) diff --git a/eth/filters/BUILD.bazel b/eth/filters/BUILD.bazel new file mode 100644 index 000000000000..e5821f3caa4a --- /dev/null +++ b/eth/filters/BUILD.bazel @@ -0,0 +1,59 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "filters", + srcs = [ + "api.go", + "filter.go", + "filter_system.go", + ], + importpath = "github.com/ava-labs/libevm/eth/filters", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/hexutil", + "//common/lru", + "//core", + "//core/bloombits", + "//core/rawdb", + "//core/types", + "//ethdb", + "//event", + "//internal/ethapi", + "//log", + "//params", + "//rpc", + ], +) + +go_test( + name = "filters_test", + srcs = [ + "api_test.go", + "bench_test.go", + "filter_system_test.go", + "filter_test.go", + ], + embed = [":filters"], + deps = [ + "//:libevm", + "//accounts/abi", + "//common", + "//common/bitutil", + "//consensus/ethash", + "//core", + "//core/bloombits", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//ethdb", + "//event", + "//internal/ethapi", + "//node", + "//params", + "//rpc", + "//triedb", + ], +) diff --git a/eth/gasestimator/BUILD.bazel b/eth/gasestimator/BUILD.bazel new file mode 100644 index 000000000000..5eb70e4d0922 --- /dev/null +++ b/eth/gasestimator/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "gasestimator", + srcs = ["gasestimator.go"], + importpath = "github.com/ava-labs/libevm/eth/gasestimator", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core", + "//core/state", + "//core/types", + "//core/vm", + "//log", + "//params", + ], +) diff --git a/eth/gasprice/BUILD.bazel b/eth/gasprice/BUILD.bazel new file mode 100644 index 000000000000..e06c7c8e7f8f --- /dev/null +++ b/eth/gasprice/BUILD.bazel @@ -0,0 +1,44 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gasprice", + srcs = [ + "feehistory.go", + "gasprice.go", + ], + importpath = "github.com/ava-labs/libevm/eth/gasprice", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/lru", + "//consensus/misc/eip1559", + "//core", + "//core/types", + "//event", + "//log", + "//params", + "//rpc", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "gasprice_test", + srcs = [ + "feehistory_test.go", + "gasprice_test.go", + ], + embed = [":gasprice"], + deps = [ + "//common", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//event", + "//params", + "//rpc", + ], +) diff --git a/eth/protocols/eth/BUILD.bazel b/eth/protocols/eth/BUILD.bazel new file mode 100644 index 000000000000..a3171f6a13ae --- /dev/null +++ b/eth/protocols/eth/BUILD.bazel @@ -0,0 +1,65 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "eth", + srcs = [ + "broadcast.go", + "discovery.go", + "dispatcher.go", + "handler.go", + "handlers.go", + "handshake.go", + "metrics.go", + "peer.go", + "protocol.go", + "tracker.go", + ], + importpath = "github.com/ava-labs/libevm/eth/protocols/eth", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core", + "//core/forkid", + "//core/types", + "//log", + "//metrics", + "//p2p", + "//p2p/enode", + "//p2p/enr", + "//p2p/tracker", + "//params", + "//rlp", + "//trie", + "@com_github_deckarep_golang_set_v2//:golang-set", + ], +) + +go_test( + name = "eth_test", + srcs = [ + "handler_test.go", + "handshake_test.go", + "peer_test.go", + "protocol_test.go", + ], + embed = [":eth"], + deps = [ + "//common", + "//consensus", + "//consensus/beacon", + "//consensus/ethash", + "//core", + "//core/forkid", + "//core/rawdb", + "//core/txpool", + "//core/txpool/legacypool", + "//core/types", + "//core/vm", + "//crypto", + "//ethdb", + "//p2p", + "//p2p/enode", + "//params", + "//rlp", + ], +) diff --git a/eth/protocols/snap/BUILD.bazel b/eth/protocols/snap/BUILD.bazel new file mode 100644 index 000000000000..0021e2d85c0d --- /dev/null +++ b/eth/protocols/snap/BUILD.bazel @@ -0,0 +1,75 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "snap", + srcs = [ + "discovery.go", + "handler.go", + "metrics.go", + "peer.go", + "protocol.go", + "range.go", + "sync.go", + "tracker.go", + ], + importpath = "github.com/ava-labs/libevm/eth/protocols/snap", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//crypto", + "//ethdb", + "//event", + "//log", + "//metrics", + "//p2p", + "//p2p/enode", + "//p2p/enr", + "//p2p/msgrate", + "//p2p/tracker", + "//rlp", + "//trie", + "//trie/trienode", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "snap_test", + srcs = [ + "handler_fuzzing_test.go", + "range_test.go", + "sort_test.go", + "sync_test.go", + ], + embed = [":snap"], + deps = [ + "//common", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//crypto", + "//ethdb", + "//log", + "//p2p", + "//p2p/enode", + "//params", + "//rlp", + "//trie", + "//trie/testutil", + "//trie/trienode", + "//triedb", + "//triedb/pathdb", + "@com_github_google_gofuzz//:gofuzz", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) diff --git a/eth/tracers/BUILD.bazel b/eth/tracers/BUILD.bazel new file mode 100644 index 000000000000..f72dbe0760dd --- /dev/null +++ b/eth/tracers/BUILD.bazel @@ -0,0 +1,58 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tracers", + srcs = [ + "api.go", + "tracers.go", + "tracker.go", + ], + importpath = "github.com/ava-labs/libevm/eth/tracers", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//consensus", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//eth/tracers/logger", + "//ethdb", + "//internal/ethapi", + "//log", + "//params", + "//rlp", + "//rpc", + ], +) + +go_test( + name = "tracers_test", + srcs = [ + "api_test.go", + "tracers_test.go", + "tracker_test.go", + ], + embed = [":tracers"], + deps = [ + "//common", + "//common/hexutil", + "//consensus", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//eth/tracers/logger", + "//ethdb", + "//internal/ethapi", + "//params", + "//rpc", + "//tests", + "@org_golang_x_exp//slices", + ], +) diff --git a/eth/tracers/internal/tracetest/BUILD.bazel b/eth/tracers/internal/tracetest/BUILD.bazel new file mode 100644 index 000000000000..a204832144a9 --- /dev/null +++ b/eth/tracers/internal/tracetest/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tracetest", + srcs = ["util.go"], + importpath = "github.com/ava-labs/libevm/eth/tracers/internal/tracetest", + visibility = ["//eth/tracers:__subpackages__"], + deps = [ + "//eth/tracers/js", + "//eth/tracers/native", + ], +) + +go_test( + name = "tracetest_test", + srcs = [ + "calltrace_test.go", + "flat_calltrace_test.go", + "prestate_test.go", + ], + data = glob(["testdata/**"]), + embed = [":tracetest"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//eth/tracers", + "//params", + "//rlp", + "//tests", + ], +) diff --git a/eth/tracers/js/BUILD.bazel b/eth/tracers/js/BUILD.bazel new file mode 100644 index 000000000000..4c8a65df3eaf --- /dev/null +++ b/eth/tracers/js/BUILD.bazel @@ -0,0 +1,34 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "js", + srcs = [ + "bigint.go", + "goja.go", + ], + importpath = "github.com/ava-labs/libevm/eth/tracers/js", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//core/vm", + "//crypto", + "//eth/tracers", + "//eth/tracers/js/internal/tracers", + "@com_github_dop251_goja//:goja", + ], +) + +go_test( + name = "js_test", + srcs = ["tracer_test.go"], + embed = [":js"], + deps = [ + "//common", + "//core/state", + "//core/vm", + "//eth/tracers", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/eth/tracers/js/internal/tracers/BUILD.bazel b/eth/tracers/js/internal/tracers/BUILD.bazel new file mode 100644 index 000000000000..f55b5c52c009 --- /dev/null +++ b/eth/tracers/js/internal/tracers/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "tracers", + srcs = ["tracers.go"], + embedsrcs = [ + "4byte_tracer_legacy.js", + "bigram_tracer.js", + "call_tracer_legacy.js", + "evmdis_tracer.js", + "noop_tracer_legacy.js", + "opcount_tracer.js", + "prestate_tracer_legacy.js", + "trigram_tracer.js", + "unigram_tracer.js", + ], + importpath = "github.com/ava-labs/libevm/eth/tracers/js/internal/tracers", + visibility = ["//eth/tracers/js:__subpackages__"], +) diff --git a/eth/tracers/logger/BUILD.bazel b/eth/tracers/logger/BUILD.bazel new file mode 100644 index 000000000000..4279790c4cb7 --- /dev/null +++ b/eth/tracers/logger/BUILD.bazel @@ -0,0 +1,35 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "logger", + srcs = [ + "access_list_tracer.go", + "gen_structlog.go", + "logger.go", + "logger_json.go", + ], + importpath = "github.com/ava-labs/libevm/eth/tracers/logger", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core/types", + "//core/vm", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "logger_test", + srcs = ["logger_test.go"], + embed = [":logger"], + deps = [ + "//common", + "//core/state", + "//core/vm", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/eth/tracers/native/BUILD.bazel b/eth/tracers/native/BUILD.bazel new file mode 100644 index 000000000000..ccdfd6310849 --- /dev/null +++ b/eth/tracers/native/BUILD.bazel @@ -0,0 +1,29 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "native", + srcs = [ + "4byte.go", + "call.go", + "call_flat.go", + "gen_account_json.go", + "gen_callframe_json.go", + "gen_flatcallaction_json.go", + "gen_flatcallresult_json.go", + "mux.go", + "noop.go", + "prestate.go", + "prestate_libevm.go", + ], + importpath = "github.com/ava-labs/libevm/eth/tracers/native", + visibility = ["//visibility:public"], + deps = [ + "//accounts/abi", + "//common", + "//common/hexutil", + "//core/vm", + "//crypto", + "//eth/tracers", + "//log", + ], +) diff --git a/ethclient/BUILD.bazel b/ethclient/BUILD.bazel new file mode 100644 index 000000000000..4c6e0c334fd0 --- /dev/null +++ b/ethclient/BUILD.bazel @@ -0,0 +1,37 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ethclient", + srcs = [ + "ethclient.go", + "signer.go", + ], + importpath = "github.com/ava-labs/libevm/ethclient", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/hexutil", + "//core/types", + "//rpc", + ], +) + +go_test( + name = "ethclient_test", + srcs = ["ethclient_test.go"], + embed = [":ethclient"], + deps = [ + "//:libevm", + "//common", + "//consensus/ethash", + "//core", + "//core/types", + "//crypto", + "//eth", + "//eth/ethconfig", + "//node", + "//params", + "//rpc", + ], +) diff --git a/ethclient/gethclient/BUILD.bazel b/ethclient/gethclient/BUILD.bazel new file mode 100644 index 000000000000..96fd511380f2 --- /dev/null +++ b/ethclient/gethclient/BUILD.bazel @@ -0,0 +1,37 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gethclient", + srcs = ["gethclient.go"], + importpath = "github.com/ava-labs/libevm/ethclient/gethclient", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/hexutil", + "//core/types", + "//p2p", + "//rpc", + ], +) + +go_test( + name = "gethclient_test", + srcs = ["gethclient_test.go"], + embed = [":gethclient"], + deps = [ + "//:libevm", + "//common", + "//consensus/ethash", + "//core", + "//core/types", + "//crypto", + "//eth", + "//eth/ethconfig", + "//eth/filters", + "//ethclient", + "//node", + "//params", + "//rpc", + ], +) diff --git a/ethclient/simulated/BUILD.bazel b/ethclient/simulated/BUILD.bazel new file mode 100644 index 000000000000..40b788b76f2b --- /dev/null +++ b/ethclient/simulated/BUILD.bazel @@ -0,0 +1,45 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "simulated", + srcs = [ + "backend.go", + "options.go", + ], + importpath = "github.com/ava-labs/libevm/ethclient/simulated", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//core", + "//core/types", + "//eth", + "//eth/catalyst", + "//eth/downloader", + "//eth/ethconfig", + "//eth/filters", + "//ethclient", + "//node", + "//p2p", + "//params", + "//rpc", + ], +) + +go_test( + name = "simulated_test", + srcs = [ + "backend_test.go", + "options_test.go", + ], + embed = [":simulated"], + deps = [ + "//:libevm", + "//accounts/abi/bind", + "//common", + "//core", + "//core/types", + "//crypto", + "//params", + ], +) diff --git a/ethdb/BUILD.bazel b/ethdb/BUILD.bazel new file mode 100644 index 000000000000..a6c7134ef96a --- /dev/null +++ b/ethdb/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "ethdb", + srcs = [ + "batch.go", + "database.go", + "iterator.go", + "snapshot.go", + ], + importpath = "github.com/ava-labs/libevm/ethdb", + visibility = ["//visibility:public"], +) diff --git a/ethdb/dbtest/BUILD.bazel b/ethdb/dbtest/BUILD.bazel new file mode 100644 index 000000000000..22ebe0c990dd --- /dev/null +++ b/ethdb/dbtest/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "dbtest", + srcs = ["testsuite.go"], + importpath = "github.com/ava-labs/libevm/ethdb/dbtest", + visibility = ["//visibility:public"], + deps = [ + "//ethdb", + "@org_golang_x_exp//slices", + ], +) diff --git a/ethdb/leveldb/BUILD.bazel b/ethdb/leveldb/BUILD.bazel new file mode 100644 index 000000000000..0638ca45b77d --- /dev/null +++ b/ethdb/leveldb/BUILD.bazel @@ -0,0 +1,188 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "leveldb", + srcs = ["leveldb.go"], + importpath = "github.com/ava-labs/libevm/ethdb/leveldb", + visibility = ["//visibility:public"], + deps = select({ + "@rules_go//go/platform:aix": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:android": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:darwin": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:dragonfly": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:freebsd": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:illumos": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:ios": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:linux": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:netbsd": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:openbsd": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:osx": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:plan9": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:qnx": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:solaris": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "@rules_go//go/platform:windows": [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/filter", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/util", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "leveldb_test", + srcs = ["leveldb_test.go"], + embed = [":leveldb"], + deps = [ + "//ethdb", + "//ethdb/dbtest", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/storage", + ], +) diff --git a/ethdb/memorydb/BUILD.bazel b/ethdb/memorydb/BUILD.bazel new file mode 100644 index 000000000000..56566d9f2774 --- /dev/null +++ b/ethdb/memorydb/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "memorydb", + srcs = ["memorydb.go"], + importpath = "github.com/ava-labs/libevm/ethdb/memorydb", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//ethdb", + ], +) + +go_test( + name = "memorydb_test", + srcs = ["memorydb_test.go"], + embed = [":memorydb"], + deps = [ + "//ethdb", + "//ethdb/dbtest", + ], +) diff --git a/ethdb/pebble/BUILD.bazel b/ethdb/pebble/BUILD.bazel new file mode 100644 index 000000000000..19233dbf3f8a --- /dev/null +++ b/ethdb/pebble/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pebble", + srcs = ["pebble.go"], + importpath = "github.com/ava-labs/libevm/ethdb/pebble", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//ethdb", + "//log", + "//metrics", + "@com_github_cockroachdb_pebble//:pebble", + "@com_github_cockroachdb_pebble//bloom", + ], +) + +go_test( + name = "pebble_test", + srcs = ["pebble_test.go"], + embed = [":pebble"], + deps = [ + "//ethdb", + "//ethdb/dbtest", + "@com_github_cockroachdb_pebble//:pebble", + "@com_github_cockroachdb_pebble//vfs", + ], +) diff --git a/ethdb/remotedb/BUILD.bazel b/ethdb/remotedb/BUILD.bazel new file mode 100644 index 000000000000..b3f1ac4147eb --- /dev/null +++ b/ethdb/remotedb/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "remotedb", + srcs = ["remotedb.go"], + importpath = "github.com/ava-labs/libevm/ethdb/remotedb", + visibility = ["//visibility:public"], + deps = [ + "//common/hexutil", + "//ethdb", + "//rpc", + ], +) diff --git a/ethstats/BUILD.bazel b/ethstats/BUILD.bazel new file mode 100644 index 000000000000..9bc175fe1aea --- /dev/null +++ b/ethstats/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ethstats", + srcs = ["ethstats.go"], + importpath = "github.com/ava-labs/libevm/ethstats", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/mclock", + "//consensus", + "//core", + "//core/types", + "//eth/protocols/eth", + "//event", + "//log", + "//miner", + "//node", + "//p2p", + "//rpc", + "@com_github_gorilla_websocket//:websocket", + ], +) + +go_test( + name = "ethstats_test", + srcs = ["ethstats_test.go"], + embed = [":ethstats"], +) diff --git a/event/BUILD.bazel b/event/BUILD.bazel new file mode 100644 index 000000000000..1879ec73497f --- /dev/null +++ b/event/BUILD.bazel @@ -0,0 +1,31 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "event", + srcs = [ + "event.go", + "feed.go", + "feedof.go", + "multisub.go", + "subscription.go", + ], + importpath = "github.com/ava-labs/libevm/event", + visibility = ["//visibility:public"], + deps = ["//common/mclock"], +) + +go_test( + name = "event_test", + srcs = [ + "event_test.go", + "example_feed_test.go", + "example_scope_test.go", + "example_subscription_test.go", + "example_test.go", + "feed_test.go", + "feedof_test.go", + "multisub_test.go", + "subscription_test.go", + ], + embed = [":event"], +) diff --git a/graphql/BUILD.bazel b/graphql/BUILD.bazel new file mode 100644 index 000000000000..6e4d1af3db0a --- /dev/null +++ b/graphql/BUILD.bazel @@ -0,0 +1,53 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "graphql", + srcs = [ + "graphiql.go", + "graphql.go", + "schema.go", + "service.go", + ], + importpath = "github.com/ava-labs/libevm/graphql", + visibility = ["//visibility:public"], + deps = [ + "//:libevm", + "//common", + "//common/hexutil", + "//common/math", + "//consensus/misc/eip1559", + "//core/state", + "//core/types", + "//eth/filters", + "//graphql/internal/graphiql", + "//internal/ethapi", + "//log", + "//node", + "//rlp", + "//rpc", + "@com_github_graph_gophers_graphql_go//:graphql-go", + "@com_github_graph_gophers_graphql_go//errors", + ], +) + +go_test( + name = "graphql_test", + srcs = ["graphql_test.go"], + embed = [":graphql"], + deps = [ + "//common", + "//consensus", + "//consensus/beacon", + "//consensus/ethash", + "//core", + "//core/types", + "//core/vm", + "//crypto", + "//eth", + "//eth/ethconfig", + "//eth/filters", + "//node", + "//params", + "@com_github_stretchr_testify//assert", + ], +) diff --git a/graphql/internal/graphiql/BUILD.bazel b/graphql/internal/graphiql/BUILD.bazel new file mode 100644 index 000000000000..b5523bace088 --- /dev/null +++ b/graphql/internal/graphiql/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "graphiql", + srcs = ["build.go"], + embedsrcs = [ + "graphiql.min.css", + "graphiql.min.js", + "index.html", + "react-dom.production.min.js", + "react.production.min.js", + ], + importpath = "github.com/ava-labs/libevm/graphql/internal/graphiql", + visibility = ["//graphql:__subpackages__"], +) diff --git a/internal/blocktest/BUILD.bazel b/internal/blocktest/BUILD.bazel new file mode 100644 index 000000000000..aaa9eafbfe5e --- /dev/null +++ b/internal/blocktest/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "blocktest", + srcs = ["test_hash.go"], + importpath = "github.com/ava-labs/libevm/internal/blocktest", + visibility = ["//:__subpackages__"], + deps = [ + "//common", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/internal/build/BUILD.bazel b/internal/build/BUILD.bazel new file mode 100644 index 000000000000..f91d10aa4c1a --- /dev/null +++ b/internal/build/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "build", + srcs = [ + "archive.go", + "azure.go", + "download.go", + "env.go", + "gotool.go", + "pgp.go", + "util.go", + ], + importpath = "github.com/ava-labs/libevm/internal/build", + visibility = ["//:__subpackages__"], + deps = [ + "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob", + "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//container", + "@org_golang_x_crypto//openpgp", + ], +) diff --git a/internal/cmdtest/BUILD.bazel b/internal/cmdtest/BUILD.bazel new file mode 100644 index 000000000000..957401d93ea9 --- /dev/null +++ b/internal/cmdtest/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "cmdtest", + srcs = ["test_cmd.go"], + importpath = "github.com/ava-labs/libevm/internal/cmdtest", + visibility = ["//:__subpackages__"], + deps = ["//internal/reexec"], +) diff --git a/internal/debug/BUILD.bazel b/internal/debug/BUILD.bazel new file mode 100644 index 000000000000..54c24260efda --- /dev/null +++ b/internal/debug/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "debug", + srcs = [ + "api.go", + "flags.go", + "loudpanic.go", + "trace.go", + ], + importpath = "github.com/ava-labs/libevm/internal/debug", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/flags", + "//log", + "//metrics", + "//metrics/exp", + "@com_github_hashicorp_go_bexpr//:go-bexpr", + "@com_github_mattn_go_colorable//:go-colorable", + "@com_github_mattn_go_isatty//:go-isatty", + "@com_github_urfave_cli_v2//:cli", + "@in_gopkg_natefinch_lumberjack_v2//:lumberjack_v2", + "@org_golang_x_exp//slog", + ], +) diff --git a/internal/era/BUILD.bazel b/internal/era/BUILD.bazel new file mode 100644 index 000000000000..29597c953952 --- /dev/null +++ b/internal/era/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "era", + srcs = [ + "accumulator.go", + "builder.go", + "era.go", + "iterator.go", + ], + importpath = "github.com/ava-labs/libevm/internal/era", + visibility = ["//:__subpackages__"], + deps = [ + "//common", + "//core/types", + "//internal/era/e2store", + "//rlp", + "@com_github_ferranbt_fastssz//:fastssz", + "@com_github_golang_snappy//:snappy", + ], +) + +go_test( + name = "era_test", + srcs = ["era_test.go"], + embed = [":era"], + deps = ["//common"], +) diff --git a/internal/era/e2store/BUILD.bazel b/internal/era/e2store/BUILD.bazel new file mode 100644 index 000000000000..34ddbc681809 --- /dev/null +++ b/internal/era/e2store/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "e2store", + srcs = ["e2store.go"], + importpath = "github.com/ava-labs/libevm/internal/era/e2store", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "e2store_test", + srcs = ["e2store_test.go"], + embed = [":e2store"], + deps = ["//common"], +) diff --git a/internal/ethapi/BUILD.bazel b/internal/ethapi/BUILD.bazel new file mode 100644 index 000000000000..ed2f53ef580e --- /dev/null +++ b/internal/ethapi/BUILD.bazel @@ -0,0 +1,84 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ethapi", + srcs = [ + "addrlock.go", + "api.go", + "backend.go", + "dbapi.go", + "errors.go", + "transaction_args.go", + ], + importpath = "github.com/ava-labs/libevm/internal/ethapi", + visibility = ["//:__subpackages__"], + deps = [ + "//:libevm", + "//accounts", + "//accounts/abi", + "//accounts/keystore", + "//accounts/scwallet", + "//common", + "//common/hexutil", + "//common/math", + "//consensus", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core", + "//core/bloombits", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//crypto/kzg4844", + "//eth/gasestimator", + "//eth/tracers/logger", + "//ethdb", + "//event", + "//log", + "//p2p", + "//params", + "//rlp", + "//rpc", + "//trie", + "@com_github_davecgh_go_spew//spew", + "@com_github_holiman_uint256//:uint256", + "@com_github_tyler_smith_go_bip39//:go-bip39", + ], +) + +go_test( + name = "ethapi_test", + srcs = [ + "api_test.go", + "transaction_args_test.go", + ], + data = glob(["testdata/**"]), + embed = [":ethapi"], + deps = [ + "//:libevm", + "//accounts", + "//accounts/keystore", + "//common", + "//common/hexutil", + "//consensus", + "//consensus/beacon", + "//consensus/ethash", + "//core", + "//core/bloombits", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//crypto", + "//crypto/kzg4844", + "//ethdb", + "//event", + "//internal/blocktest", + "//params", + "//rpc", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//require", + "@org_golang_x_exp//slices", + ], +) diff --git a/internal/flags/BUILD.bazel b/internal/flags/BUILD.bazel new file mode 100644 index 000000000000..c5166aa83626 --- /dev/null +++ b/internal/flags/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "flags", + srcs = [ + "categories.go", + "flags.go", + "helpers.go", + ], + importpath = "github.com/ava-labs/libevm/internal/flags", + visibility = ["//:__subpackages__"], + deps = [ + "//common/math", + "//internal/version", + "//log", + "//params", + "@com_github_mattn_go_isatty//:go-isatty", + "@com_github_urfave_cli_v2//:cli", + ], +) + +go_test( + name = "flags_test", + srcs = ["flags_test.go"], + embed = [":flags"], +) diff --git a/internal/guide/BUILD.bazel b/internal/guide/BUILD.bazel new file mode 100644 index 000000000000..bbfd18ccfbba --- /dev/null +++ b/internal/guide/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "guide", + srcs = ["guide.go"], + importpath = "github.com/ava-labs/libevm/internal/guide", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "guide_test", + srcs = ["guide_test.go"], + embed = [":guide"], + deps = [ + "//accounts/keystore", + "//common", + "//core/types", + ], +) diff --git a/internal/jsre/BUILD.bazel b/internal/jsre/BUILD.bazel new file mode 100644 index 000000000000..9c4d4ecd7abe --- /dev/null +++ b/internal/jsre/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "jsre", + srcs = [ + "completion.go", + "jsre.go", + "pretty.go", + ], + importpath = "github.com/ava-labs/libevm/internal/jsre", + visibility = ["//:__subpackages__"], + deps = [ + "//common", + "@com_github_dop251_goja//:goja", + "@com_github_fatih_color//:color", + ], +) + +go_test( + name = "jsre_test", + srcs = [ + "completion_test.go", + "jsre_test.go", + ], + embed = [":jsre"], + deps = ["@com_github_dop251_goja//:goja"], +) diff --git a/internal/jsre/deps/BUILD.bazel b/internal/jsre/deps/BUILD.bazel new file mode 100644 index 000000000000..34ccd2a9f40f --- /dev/null +++ b/internal/jsre/deps/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "deps", + srcs = ["deps.go"], + embedsrcs = [ + "bignumber.js", + "web3.js", + ], + importpath = "github.com/ava-labs/libevm/internal/jsre/deps", + visibility = ["//:__subpackages__"], +) diff --git a/internal/reexec/BUILD.bazel b/internal/reexec/BUILD.bazel new file mode 100644 index 000000000000..97f70e9c306b --- /dev/null +++ b/internal/reexec/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "reexec", + srcs = [ + "reexec.go", + "self_linux.go", + "self_others.go", + ], + importpath = "github.com/ava-labs/libevm/internal/reexec", + visibility = ["//:__subpackages__"], +) diff --git a/internal/shutdowncheck/BUILD.bazel b/internal/shutdowncheck/BUILD.bazel new file mode 100644 index 000000000000..71f2829b8c96 --- /dev/null +++ b/internal/shutdowncheck/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "shutdowncheck", + srcs = ["shutdown_tracker.go"], + importpath = "github.com/ava-labs/libevm/internal/shutdowncheck", + visibility = ["//:__subpackages__"], + deps = [ + "//common", + "//core/rawdb", + "//ethdb", + "//log", + ], +) diff --git a/internal/syncx/BUILD.bazel b/internal/syncx/BUILD.bazel new file mode 100644 index 000000000000..0e7949947324 --- /dev/null +++ b/internal/syncx/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "syncx", + srcs = ["mutex.go"], + importpath = "github.com/ava-labs/libevm/internal/syncx", + visibility = ["//:__subpackages__"], +) diff --git a/internal/testlog/BUILD.bazel b/internal/testlog/BUILD.bazel new file mode 100644 index 000000000000..5c9f5c1268b0 --- /dev/null +++ b/internal/testlog/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "testlog", + srcs = ["testlog.go"], + importpath = "github.com/ava-labs/libevm/internal/testlog", + visibility = ["//:__subpackages__"], + deps = [ + "//log", + "@org_golang_x_exp//slog", + ], +) diff --git a/internal/utesting/BUILD.bazel b/internal/utesting/BUILD.bazel new file mode 100644 index 000000000000..a80a771f5ed3 --- /dev/null +++ b/internal/utesting/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utesting", + srcs = ["utesting.go"], + importpath = "github.com/ava-labs/libevm/internal/utesting", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "utesting_test", + srcs = ["utesting_test.go"], + embed = [":utesting"], +) diff --git a/internal/version/BUILD.bazel b/internal/version/BUILD.bazel new file mode 100644 index 000000000000..84c76c8a9a13 --- /dev/null +++ b/internal/version/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "version", + srcs = [ + "vcs.go", + "version.go", + ], + importpath = "github.com/ava-labs/libevm/internal/version", + visibility = ["//:__subpackages__"], + deps = ["//params"], +) diff --git a/internal/web3ext/BUILD.bazel b/internal/web3ext/BUILD.bazel new file mode 100644 index 000000000000..e365a8cd1e98 --- /dev/null +++ b/internal/web3ext/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "web3ext", + srcs = ["web3ext.go"], + importpath = "github.com/ava-labs/libevm/internal/web3ext", + visibility = ["//:__subpackages__"], +) diff --git a/libevm/BUILD.bazel b/libevm/BUILD.bazel new file mode 100644 index 000000000000..5d28b0c3d74b --- /dev/null +++ b/libevm/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "libevm", + srcs = ["libevm.go"], + importpath = "github.com/ava-labs/libevm/libevm", + visibility = ["//visibility:public"], + deps = [ + "//common", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "libevm_test", + srcs = ["interfaces_test.go"], + deps = [ + ":libevm", + "//core/vm", + ], +) diff --git a/libevm/cmd/internalise/BUILD.bazel b/libevm/cmd/internalise/BUILD.bazel new file mode 100644 index 000000000000..ff98dccdc078 --- /dev/null +++ b/libevm/cmd/internalise/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "internalise_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/libevm/cmd/internalise", + visibility = ["//visibility:private"], +) + +go_binary( + name = "internalise", + embed = [":internalise_lib"], + visibility = ["//visibility:public"], +) diff --git a/libevm/ethtest/BUILD.bazel b/libevm/ethtest/BUILD.bazel new file mode 100644 index 000000000000..eb61d787649e --- /dev/null +++ b/libevm/ethtest/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "ethtest", + srcs = [ + "evm.go", + "rand.go", + ], + importpath = "github.com/ava-labs/libevm/libevm/ethtest", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core", + "//core/rawdb", + "//core/state", + "//core/types", + "//core/vm", + "//params", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//require", + "@org_golang_x_exp//rand", + ], +) diff --git a/libevm/hookstest/BUILD.bazel b/libevm/hookstest/BUILD.bazel new file mode 100644 index 000000000000..84482f1d1d05 --- /dev/null +++ b/libevm/hookstest/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "hookstest", + srcs = ["stub.go"], + importpath = "github.com/ava-labs/libevm/libevm/hookstest", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//libevm", + "//params", + ], +) diff --git a/libevm/internal/bazel/BUILD.bazel b/libevm/internal/bazel/BUILD.bazel new file mode 100644 index 000000000000..d518110449e6 --- /dev/null +++ b/libevm/internal/bazel/BUILD.bazel @@ -0,0 +1 @@ +exports_files(glob(["*.patch"])) diff --git a/libevm/internal/bazel/com_github_karalabe_usb.patch b/libevm/internal/bazel/com_github_karalabe_usb.patch new file mode 100644 index 000000000000..bbff22e20b75 --- /dev/null +++ b/libevm/internal/bazel/com_github_karalabe_usb.patch @@ -0,0 +1,122 @@ +--- BUILD.bazel ++++ BUILD.bazel +@@ -14,6 +14,12 @@ + "usb_enabled.go", + "wchar.go", + ], + cgo = True, ++ cdeps = [ ++ "//hidapi/hidapi", ++ "//hidapi/libusb", ++ "//hidapi/mac", ++ "//libusb/libusb", ++ ], + clinkopts = select({ + "@io_bazel_rules_go//go/platform:darwin": [ +@@ -35,36 +41,37 @@ + "-DDEFAULT_VISIBILITY=", + "-DOS_LINUX -D_GNU_SOURCE -DHAVE_SYS_TIME_H", + "-DPOLL_NFDS_TYPE=int", +- "-Ihidapi/hidapi", +- "-Ilibusb/libusb", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/hidapi", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/libusb/libusb", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "-DDEFAULT_VISIBILITY=", + "-DOS_DARWIN -DHAVE_SYS_TIME_H", + "-DPOLL_NFDS_TYPE=int", +- "-Ihidapi/hidapi", +- "-Ilibusb/libusb", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/hidapi", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/mac", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/libusb/libusb", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "-DDEFAULT_VISIBILITY=", + "-DOS_FREEBSD", + "-DPOLL_NFDS_TYPE=int", +- "-Ihidapi/hidapi", +- "-Ilibusb/libusb", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/hidapi", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/libusb/libusb", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "-DDEFAULT_VISIBILITY=", + "-DOS_LINUX -D_GNU_SOURCE -DHAVE_SYS_TIME_H", + "-DPOLL_NFDS_TYPE=int", +- "-Ihidapi/hidapi", +- "-Ilibusb/libusb", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/hidapi", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/libusb/libusb", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "-DDEFAULT_VISIBILITY=", + "-DOS_WINDOWS", + "-DPOLL_NFDS_TYPE=int", +- "-Ihidapi/hidapi", +- "-Ilibusb/libusb", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/hidapi/hidapi", ++ "-Iexternal/gazelle++go_deps+com_github_karalabe_usb/libusb/libusb", + ], + "//conditions:default": [], + }), + + +--- hidapi/BUILD.bazel ++++ hidapi/BUILD.bazel +@@ -0,0 +1,1 @@ ++ + +--- hidapi/hidapi/BUILD.bazel ++++ hidapi/hidapi/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "hidapi", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) + +--- hidapi/libusb/BUILD.bazel ++++ hidapi/libusb/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "libusb", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) + +--- hidapi/mac/BUILD.bazel ++++ hidapi/mac/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "mac", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) + +--- libusb/BUILD.bazel ++++ libusb/BUILD.bazel +@@ -0,0 +1,1 @@ ++ + +--- libusb/libusb/BUILD.bazel ++++ libusb/libusb/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "libusb", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) diff --git a/libevm/internal/bazel/com_github_supranational_blst.patch b/libevm/internal/bazel/com_github_supranational_blst.patch new file mode 100644 index 000000000000..8b1efe4eb8e9 --- /dev/null +++ b/libevm/internal/bazel/com_github_supranational_blst.patch @@ -0,0 +1,129 @@ +--- bindings/go/BUILD.bazel ++++ bindings/go/BUILD.bazel +@@ -1,40 +1,61 @@ + load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + ++COPTS = [ ++ "-Iexternal/gazelle++go_deps+com_github_supranational_blst/bindings -Iexternal/gazelle++go_deps+com_github_supranational_blst/build -Iexternal/gazelle++go_deps+com_github_supranational_blst/src -D__BLST_CGO__ -fno-builtin-memcpy -fno-builtin-memset", ++] + select({ ++ "@io_bazel_rules_go//go/platform:amd64": [ ++ "-D__ADX__ -mno-avx", ++ ], ++ "@io_bazel_rules_go//go/platform:mips64": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "@io_bazel_rules_go//go/platform:mips64le": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "@io_bazel_rules_go//go/platform:ppc64": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "@io_bazel_rules_go//go/platform:ppc64le": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "@io_bazel_rules_go//go/platform:riscv64": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "@io_bazel_rules_go//go/platform:s390x": [ ++ "-D__BLST_NO_ASM__", ++ ], ++ "//conditions:default": [], ++}) ++ ++cc_library( ++ name = "cgo", ++ srcs = [ ++ "cgo_assembly.S", ++ "cgo_server.c", ++ ], ++ deps = [ ++ "//bindings", ++ "//build", ++ "//src", ++ ], ++ copts = COPTS, ++ visibility = ["//visibility:private"], ++) ++ + go_library( + name = "go", + srcs = [ + "blst.go", +- "cgo_assembly.S", +- "cgo_server.c", + "rb_tree.go", + ], + cgo = True, +- copts = [ +- "-Ibindings/go/external/gazelle++go_deps+com_github_supranational_blst/bindings -Ibindings/go/external/gazelle++go_deps+com_github_supranational_blst/build -Ibindings/go/external/gazelle++go_deps+com_github_supranational_blst/src -D__BLST_CGO__ -fno-builtin-memcpy -fno-builtin-memset", +- ] + select({ +- "@io_bazel_rules_go//go/platform:amd64": [ +- "-D__ADX__ -mno-avx", +- ], +- "@io_bazel_rules_go//go/platform:mips64": [ +- "-D__BLST_NO_ASM__", +- ], +- "@io_bazel_rules_go//go/platform:mips64le": [ +- "-D__BLST_NO_ASM__", +- ], +- "@io_bazel_rules_go//go/platform:ppc64": [ +- "-D__BLST_NO_ASM__", +- ], +- "@io_bazel_rules_go//go/platform:ppc64le": [ +- "-D__BLST_NO_ASM__", +- ], +- "@io_bazel_rules_go//go/platform:riscv64": [ +- "-D__BLST_NO_ASM__", +- ], +- "@io_bazel_rules_go//go/platform:s390x": [ +- "-D__BLST_NO_ASM__", +- ], +- "//conditions:default": [], +- }), ++ cdeps = [ ++ ":cgo", ++ "//bindings", ++ "//build", ++ "//src", ++ ], ++ copts = COPTS, + importpath = "github.com/supranational/blst/bindings/go", + visibility = ["//visibility:public"], + ) + +--- bindings/BUILD.bazel ++++ bindings/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "bindings", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) + +--- build/BUILD.bazel ++++ build/BUILD.bazel +@@ -0,0 +1,9 @@ ++cc_library( ++ name = "build", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ "**/*.S", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) + +--- src/BUILD.bazel ++++ src/BUILD.bazel +@@ -0,0 +1,8 @@ ++cc_library( ++ name = "src", ++ hdrs = glob([ ++ "**/*.c", ++ "**/*.h", ++ ], allow_empty=True), ++ visibility = ["//:__subpackages__"], ++) diff --git a/libevm/legacy/BUILD.bazel b/libevm/legacy/BUILD.bazel new file mode 100644 index 000000000000..2bca977c8766 --- /dev/null +++ b/libevm/legacy/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "legacy", + srcs = ["legacy.go"], + importpath = "github.com/ava-labs/libevm/libevm/legacy", + visibility = ["//visibility:public"], + deps = ["//core/vm"], +) + +go_test( + name = "legacy_test", + srcs = ["legacy_test.go"], + embed = [":legacy"], + deps = [ + "//core/vm", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/libevm/options/BUILD.bazel b/libevm/options/BUILD.bazel new file mode 100644 index 000000000000..17c3cf623a11 --- /dev/null +++ b/libevm/options/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "options", + srcs = ["options.go"], + importpath = "github.com/ava-labs/libevm/libevm/options", + visibility = ["//visibility:public"], +) diff --git a/libevm/pseudo/BUILD.bazel b/libevm/pseudo/BUILD.bazel new file mode 100644 index 000000000000..5bb5dd3fd38e --- /dev/null +++ b/libevm/pseudo/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pseudo", + srcs = [ + "accessor.go", + "constructor.go", + "fmt.go", + "reflect.go", + "type.go", + ], + importpath = "github.com/ava-labs/libevm/libevm/pseudo", + visibility = ["//visibility:public"], + deps = ["//rlp"], +) + +go_test( + name = "pseudo_test", + srcs = [ + "constructor_test.go", + "fmt_test.go", + "rlp_test.go", + "type_test.go", + ], + embed = [":pseudo"], + deps = [ + "//core/types", + "//libevm/ethtest", + "//rlp", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/libevm/register/BUILD.bazel b/libevm/register/BUILD.bazel new file mode 100644 index 000000000000..7179423813d9 --- /dev/null +++ b/libevm/register/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "register", + srcs = ["register.go"], + importpath = "github.com/ava-labs/libevm/libevm/register", + visibility = ["//visibility:public"], + deps = ["//libevm/testonly"], +) diff --git a/libevm/set/BUILD.bazel b/libevm/set/BUILD.bazel new file mode 100644 index 000000000000..1c2c6930041f --- /dev/null +++ b/libevm/set/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "set", + srcs = ["set.go"], + importpath = "github.com/ava-labs/libevm/libevm/set", + visibility = ["//visibility:public"], +) + +go_test( + name = "set_test", + srcs = ["set_test.go"], + embed = [":set"], + deps = ["@com_github_stretchr_testify//assert"], +) diff --git a/libevm/stateconf/BUILD.bazel b/libevm/stateconf/BUILD.bazel new file mode 100644 index 000000000000..ed45cfd6a87e --- /dev/null +++ b/libevm/stateconf/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "stateconf", + srcs = ["conf.go"], + importpath = "github.com/ava-labs/libevm/libevm/stateconf", + visibility = ["//visibility:public"], + deps = ["//libevm/options"], +) diff --git a/libevm/sync/BUILD.bazel b/libevm/sync/BUILD.bazel new file mode 100644 index 000000000000..eade8a5a8a8e --- /dev/null +++ b/libevm/sync/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "sync", + srcs = ["sync.go"], + importpath = "github.com/ava-labs/libevm/libevm/sync", + visibility = ["//visibility:public"], +) diff --git a/libevm/testonly/BUILD.bazel b/libevm/testonly/BUILD.bazel new file mode 100644 index 000000000000..8cbe06db8b74 --- /dev/null +++ b/libevm/testonly/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "testonly", + srcs = ["testonly.go"], + importpath = "github.com/ava-labs/libevm/libevm/testonly", + visibility = ["//visibility:public"], +) diff --git a/libevm/tooling/MODULE.bazel b/libevm/tooling/MODULE.bazel new file mode 100644 index 000000000000..0feeee02feff --- /dev/null +++ b/libevm/tooling/MODULE.bazel @@ -0,0 +1 @@ +# libevm/tooling is a different Go module, currently without Bazel support diff --git a/libevm/tooling/MODULE.bazel.lock b/libevm/tooling/MODULE.bazel.lock new file mode 100644 index 000000000000..68512e3bdca0 --- /dev/null +++ b/libevm/tooling/MODULE.bazel.lock @@ -0,0 +1,138 @@ +{ + "lockFileVersion": 18, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/source.json": "f121b43eeefc7c29efbd51b83d08631e2347297c95aac9764a701f2a6a2bb953", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/source.json": "4db99b3f55c90ab28d14552aa0632533e3e8e5e9aea0f5c24ac0014282c2a7c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/source.json": "7f27af3c28037d9701487c4744b5448d26537cc66cdef0d8df7ae85411f8de95", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + }, + "selectedYankedVersions": {}, + "moduleExtensions": {} +} diff --git a/log/BUILD.bazel b/log/BUILD.bazel new file mode 100644 index 000000000000..933bba5a9e43 --- /dev/null +++ b/log/BUILD.bazel @@ -0,0 +1,34 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "log", + srcs = [ + "format.go", + "handler.go", + "handler_glog.go", + "logger.go", + "root.go", + "value.libevm.go", + ], + importpath = "github.com/ava-labs/libevm/log", + visibility = ["//visibility:public"], + deps = [ + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_exp//slog", + ], +) + +go_test( + name = "log_test", + srcs = [ + "format_test.go", + "logger_test.go", + "value.libevm_test.go", + ], + embed = [":log"], + deps = [ + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//assert", + "@org_golang_x_exp//slog", + ], +) diff --git a/metrics/BUILD.bazel b/metrics/BUILD.bazel new file mode 100644 index 000000000000..4a99a37ecf69 --- /dev/null +++ b/metrics/BUILD.bazel @@ -0,0 +1,135 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metrics", + srcs = [ + "config.go", + "counter.go", + "counter_float64.go", + "cpu.go", + "cpu_disabled.go", + "cpu_enabled.go", + "cputime_nop.go", + "cputime_unix.go", + "debug.go", + "disk.go", + "disk_linux.go", + "disk_nop.go", + "ewma.go", + "gauge.go", + "gauge_float64.go", + "gauge_info.go", + "graphite.go", + "healthcheck.go", + "histogram.go", + "inactive.go", + "json.go", + "log.go", + "meter.go", + "metrics.go", + "opentsdb.go", + "registry.go", + "resetting_sample.go", + "resetting_timer.go", + "runtimehistogram.go", + "sample.go", + "syslog.go", + "timer.go", + "writer.go", + ], + importpath = "github.com/ava-labs/libevm/metrics", + visibility = ["//visibility:public"], + deps = [ + "//log", + "@org_golang_x_exp//slices", + ] + select({ + "@rules_go//go/platform:aix": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:android": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:darwin": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:dragonfly": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:freebsd": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:illumos": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:ios": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:netbsd": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:openbsd": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:osx": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:plan9": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:qnx": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:solaris": [ + "@com_github_shirou_gopsutil//cpu", + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:windows": [ + "@com_github_shirou_gopsutil//cpu", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "metrics_test", + srcs = [ + "counter_float_64_test.go", + "counter_test.go", + "debug_test.go", + "ewma_test.go", + "gauge_float64_test.go", + "gauge_info_test.go", + "gauge_test.go", + "graphite_test.go", + "histogram_test.go", + "init_test.go", + "json_test.go", + "meter_test.go", + "metrics_test.go", + "opentsdb_test.go", + "registry_test.go", + "resetting_timer_test.go", + "runtimehistogram_test.go", + "sample_test.go", + "timer_test.go", + "writer_test.go", + ], + data = glob(["testdata/**"]), + embed = [":metrics"], + deps = ["@org_golang_x_exp//slices"], +) diff --git a/metrics/exp/BUILD.bazel b/metrics/exp/BUILD.bazel new file mode 100644 index 000000000000..f705cfc98cc1 --- /dev/null +++ b/metrics/exp/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "exp", + srcs = ["exp.go"], + importpath = "github.com/ava-labs/libevm/metrics/exp", + visibility = ["//visibility:public"], + deps = [ + "//log", + "//metrics", + "//metrics/prometheus", + ], +) diff --git a/metrics/influxdb/BUILD.bazel b/metrics/influxdb/BUILD.bazel new file mode 100644 index 000000000000..2df15051d4a5 --- /dev/null +++ b/metrics/influxdb/BUILD.bazel @@ -0,0 +1,31 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "influxdb", + srcs = [ + "influxdb.go", + "influxdbv1.go", + "influxdbv2.go", + ], + importpath = "github.com/ava-labs/libevm/metrics/influxdb", + visibility = ["//visibility:public"], + deps = [ + "//log", + "//metrics", + "@com_github_influxdata_influxdb1_client//v2:influxdb1-client", + "@com_github_influxdata_influxdb_client_go_v2//:influxdb-client-go", + "@com_github_influxdata_influxdb_client_go_v2//api", + ], +) + +go_test( + name = "influxdb_test", + srcs = ["influxdb_test.go"], + data = glob(["testdata/**"]), + embed = [":influxdb"], + deps = [ + "//metrics", + "//metrics/internal", + "@com_github_influxdata_influxdb_client_go_v2//:influxdb-client-go", + ], +) diff --git a/metrics/internal/BUILD.bazel b/metrics/internal/BUILD.bazel new file mode 100644 index 000000000000..272c71b6444c --- /dev/null +++ b/metrics/internal/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "internal", + srcs = ["sampledata.go"], + importpath = "github.com/ava-labs/libevm/metrics/internal", + visibility = ["//metrics:__subpackages__"], + deps = ["//metrics"], +) + +go_test( + name = "internal_test", + srcs = ["sampledata_test.go"], + embed = [":internal"], + deps = ["//metrics"], +) diff --git a/metrics/librato/BUILD.bazel b/metrics/librato/BUILD.bazel new file mode 100644 index 000000000000..0bac6885c9c6 --- /dev/null +++ b/metrics/librato/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "librato", + srcs = [ + "client.go", + "librato.go", + ], + importpath = "github.com/ava-labs/libevm/metrics/librato", + visibility = ["//visibility:public"], + deps = ["//metrics"], +) diff --git a/metrics/prometheus/BUILD.bazel b/metrics/prometheus/BUILD.bazel new file mode 100644 index 000000000000..e1b28fa4b552 --- /dev/null +++ b/metrics/prometheus/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "prometheus", + srcs = [ + "collector.go", + "prometheus.go", + ], + importpath = "github.com/ava-labs/libevm/metrics/prometheus", + visibility = ["//visibility:public"], + deps = [ + "//log", + "//metrics", + ], +) + +go_test( + name = "prometheus_test", + srcs = ["collector_test.go"], + data = glob(["testdata/**"]), + embed = [":prometheus"], + deps = [ + "//metrics", + "//metrics/internal", + ], +) diff --git a/miner/BUILD.bazel b/miner/BUILD.bazel new file mode 100644 index 000000000000..39dec9915420 --- /dev/null +++ b/miner/BUILD.bazel @@ -0,0 +1,67 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "miner", + srcs = [ + "miner.go", + "ordering.go", + "payload_building.go", + "worker.go", + ], + importpath = "github.com/ava-labs/libevm/miner", + visibility = ["//visibility:public"], + deps = [ + "//beacon/engine", + "//common", + "//common/hexutil", + "//consensus", + "//consensus/misc/eip1559", + "//consensus/misc/eip4844", + "//core", + "//core/state", + "//core/txpool", + "//core/types", + "//core/vm", + "//eth/downloader", + "//event", + "//log", + "//params", + "//rlp", + "//trie", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "miner_test", + srcs = [ + "miner_test.go", + "ordering_test.go", + "payload_building_test.go", + "worker_test.go", + ], + embed = [":miner"], + deps = [ + "//accounts", + "//beacon/engine", + "//common", + "//consensus", + "//consensus/clique", + "//consensus/ethash", + "//core", + "//core/rawdb", + "//core/state", + "//core/txpool", + "//core/txpool/legacypool", + "//core/types", + "//core/vm", + "//crypto", + "//eth/downloader", + "//ethdb", + "//event", + "//params", + "//trie", + "//triedb", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/miner/stress/clique/BUILD.bazel b/miner/stress/clique/BUILD.bazel new file mode 100644 index 000000000000..fa4d283c9f39 --- /dev/null +++ b/miner/stress/clique/BUILD.bazel @@ -0,0 +1,32 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "clique_lib", + srcs = ["main.go"], + importpath = "github.com/ava-labs/libevm/miner/stress/clique", + visibility = ["//visibility:private"], + deps = [ + "//accounts/keystore", + "//common", + "//common/fdlimit", + "//core", + "//core/txpool/legacypool", + "//core/types", + "//crypto", + "//eth", + "//eth/downloader", + "//eth/ethconfig", + "//log", + "//miner", + "//node", + "//p2p", + "//p2p/enode", + "//params", + ], +) + +go_binary( + name = "clique", + embed = [":clique_lib"], + visibility = ["//visibility:public"], +) diff --git a/node/BUILD.bazel b/node/BUILD.bazel new file mode 100644 index 000000000000..bf7de748ef4a --- /dev/null +++ b/node/BUILD.bazel @@ -0,0 +1,64 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "node", + srcs = [ + "api.go", + "config.go", + "defaults.go", + "doc.go", + "endpoints.go", + "errors.go", + "jwt_auth.go", + "jwt_handler.go", + "lifecycle.go", + "node.go", + "rpcstack.go", + ], + importpath = "github.com/ava-labs/libevm/node", + visibility = ["//visibility:public"], + deps = [ + "//accounts", + "//common", + "//common/hexutil", + "//core/rawdb", + "//crypto", + "//ethdb", + "//event", + "//internal/debug", + "//log", + "//p2p", + "//p2p/enode", + "//p2p/nat", + "//rpc", + "@com_github_gofrs_flock//:flock", + "@com_github_golang_jwt_jwt_v4//:jwt", + "@com_github_rs_cors//:cors", + ], +) + +go_test( + name = "node_test", + srcs = [ + "api_test.go", + "config_test.go", + "node_auth_test.go", + "node_example_test.go", + "node_test.go", + "rpcstack_test.go", + "utils_test.go", + ], + embed = [":node"], + deps = [ + "//common/hexutil", + "//crypto", + "//ethdb", + "//internal/testlog", + "//log", + "//p2p", + "//rpc", + "@com_github_golang_jwt_jwt_v4//:jwt", + "@com_github_gorilla_websocket//:websocket", + "@com_github_stretchr_testify//assert", + ], +) diff --git a/p2p/BUILD.bazel b/p2p/BUILD.bazel new file mode 100644 index 000000000000..61a827bb7226 --- /dev/null +++ b/p2p/BUILD.bazel @@ -0,0 +1,62 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "p2p", + srcs = [ + "dial.go", + "message.go", + "metrics.go", + "peer.go", + "peer_error.go", + "protocol.go", + "server.go", + "server_nat.go", + "transport.go", + "util.go", + ], + importpath = "github.com/ava-labs/libevm/p2p", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/bitutil", + "//common/mclock", + "//crypto", + "//event", + "//log", + "//metrics", + "//p2p/discover", + "//p2p/enode", + "//p2p/enr", + "//p2p/nat", + "//p2p/netutil", + "//p2p/rlpx", + "//rlp", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "p2p_test", + srcs = [ + "dial_test.go", + "message_test.go", + "peer_test.go", + "server_nat_test.go", + "server_test.go", + "transport_test.go", + "util_test.go", + ], + embed = [":p2p"], + deps = [ + "//common/mclock", + "//crypto", + "//internal/testlog", + "//log", + "//p2p/enode", + "//p2p/enr", + "//p2p/netutil", + "//p2p/rlpx", + "//p2p/simulations/pipes", + "@com_github_davecgh_go_spew//spew", + ], +) diff --git a/p2p/discover/BUILD.bazel b/p2p/discover/BUILD.bazel new file mode 100644 index 000000000000..04e450dec8d1 --- /dev/null +++ b/p2p/discover/BUILD.bazel @@ -0,0 +1,57 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "discover", + srcs = [ + "common.go", + "lookup.go", + "metrics.go", + "node.go", + "ntp.go", + "table.go", + "v4_udp.go", + "v5_talk.go", + "v5_udp.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/discover", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/math", + "//common/mclock", + "//crypto", + "//log", + "//metrics", + "//p2p/discover/v4wire", + "//p2p/discover/v5wire", + "//p2p/enode", + "//p2p/enr", + "//p2p/netutil", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "discover_test", + srcs = [ + "table_test.go", + "table_util_test.go", + "v4_lookup_test.go", + "v4_udp_test.go", + "v5_udp_test.go", + ], + embed = [":discover"], + deps = [ + "//crypto", + "//internal/testlog", + "//log", + "//p2p/discover/v4wire", + "//p2p/discover/v5wire", + "//p2p/enode", + "//p2p/enr", + "//p2p/netutil", + "//rlp", + "@com_github_stretchr_testify//require", + "@org_golang_x_exp//slices", + ], +) diff --git a/p2p/discover/v4wire/BUILD.bazel b/p2p/discover/v4wire/BUILD.bazel new file mode 100644 index 000000000000..3f90104bf921 --- /dev/null +++ b/p2p/discover/v4wire/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "v4wire", + srcs = ["v4wire.go"], + importpath = "github.com/ava-labs/libevm/p2p/discover/v4wire", + visibility = ["//visibility:public"], + deps = [ + "//common/math", + "//crypto", + "//p2p/enode", + "//p2p/enr", + "//rlp", + ], +) + +go_test( + name = "v4wire_test", + srcs = ["v4wire_test.go"], + embed = [":v4wire"], + deps = [ + "//crypto", + "//rlp", + "@com_github_davecgh_go_spew//spew", + ], +) diff --git a/p2p/discover/v5wire/BUILD.bazel b/p2p/discover/v5wire/BUILD.bazel new file mode 100644 index 000000000000..9287a7c9a1bb --- /dev/null +++ b/p2p/discover/v5wire/BUILD.bazel @@ -0,0 +1,41 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "v5wire", + srcs = [ + "crypto.go", + "encoding.go", + "msg.go", + "session.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/discover/v5wire", + visibility = ["//visibility:public"], + deps = [ + "//common/hexutil", + "//common/lru", + "//common/math", + "//common/mclock", + "//crypto", + "//p2p/enode", + "//p2p/enr", + "//rlp", + "@org_golang_x_crypto//hkdf", + ], +) + +go_test( + name = "v5wire_test", + srcs = [ + "crypto_test.go", + "encoding_test.go", + ], + data = glob(["testdata/**"]), + embed = [":v5wire"], + deps = [ + "//common/hexutil", + "//common/mclock", + "//crypto", + "//p2p/enode", + "@com_github_davecgh_go_spew//spew", + ], +) diff --git a/p2p/dnsdisc/BUILD.bazel b/p2p/dnsdisc/BUILD.bazel new file mode 100644 index 000000000000..3c0fe09a6e6f --- /dev/null +++ b/p2p/dnsdisc/BUILD.bazel @@ -0,0 +1,47 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "dnsdisc", + srcs = [ + "client.go", + "doc.go", + "error.go", + "sync.go", + "tree.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/dnsdisc", + visibility = ["//visibility:public"], + deps = [ + "//common/lru", + "//common/mclock", + "//crypto", + "//log", + "//p2p/enode", + "//p2p/enr", + "//rlp", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + "@org_golang_x_sync//singleflight", + "@org_golang_x_time//rate", + ], +) + +go_test( + name = "dnsdisc_test", + srcs = [ + "client_test.go", + "sync_test.go", + "tree_test.go", + ], + embed = [":dnsdisc"], + deps = [ + "//common/hexutil", + "//common/mclock", + "//crypto", + "//internal/testlog", + "//log", + "//p2p/enode", + "//p2p/enr", + "@com_github_davecgh_go_spew//spew", + ], +) diff --git a/p2p/enode/BUILD.bazel b/p2p/enode/BUILD.bazel new file mode 100644 index 000000000000..af9ca9d0e84d --- /dev/null +++ b/p2p/enode/BUILD.bazel @@ -0,0 +1,50 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "enode", + srcs = [ + "idscheme.go", + "iter.go", + "localnode.go", + "node.go", + "nodedb.go", + "urlv4.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/enode", + visibility = ["//visibility:public"], + deps = [ + "//common/math", + "//crypto", + "//log", + "//p2p/enr", + "//p2p/netutil", + "//rlp", + "@com_github_syndtr_goleveldb//leveldb", + "@com_github_syndtr_goleveldb//leveldb/errors", + "@com_github_syndtr_goleveldb//leveldb/iterator", + "@com_github_syndtr_goleveldb//leveldb/opt", + "@com_github_syndtr_goleveldb//leveldb/storage", + "@com_github_syndtr_goleveldb//leveldb/util", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "enode_test", + srcs = [ + "idscheme_test.go", + "iter_test.go", + "localnode_test.go", + "node_test.go", + "nodedb_test.go", + "urlv4_test.go", + ], + embed = [":enode"], + deps = [ + "//crypto", + "//p2p/enr", + "//rlp", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/p2p/enr/BUILD.bazel b/p2p/enr/BUILD.bazel new file mode 100644 index 000000000000..42ec779a40b3 --- /dev/null +++ b/p2p/enr/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "enr", + srcs = [ + "enr.go", + "entries.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/enr", + visibility = ["//visibility:public"], + deps = ["//rlp"], +) + +go_test( + name = "enr_test", + srcs = ["enr_test.go"], + embed = [":enr"], + deps = [ + "//rlp", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/p2p/msgrate/BUILD.bazel b/p2p/msgrate/BUILD.bazel new file mode 100644 index 000000000000..e05c60055ab5 --- /dev/null +++ b/p2p/msgrate/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "msgrate", + srcs = ["msgrate.go"], + importpath = "github.com/ava-labs/libevm/p2p/msgrate", + visibility = ["//visibility:public"], + deps = ["//log"], +) + +go_test( + name = "msgrate_test", + srcs = ["msgrate_test.go"], + embed = [":msgrate"], +) diff --git a/p2p/nat/BUILD.bazel b/p2p/nat/BUILD.bazel new file mode 100644 index 000000000000..e0dc655db5a6 --- /dev/null +++ b/p2p/nat/BUILD.bazel @@ -0,0 +1,29 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "nat", + srcs = [ + "nat.go", + "natpmp.go", + "natupnp.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/nat", + visibility = ["//visibility:public"], + deps = [ + "//log", + "@com_github_huin_goupnp//:goupnp", + "@com_github_huin_goupnp//dcps/internetgateway1", + "@com_github_huin_goupnp//dcps/internetgateway2", + "@com_github_jackpal_go_nat_pmp//:go-nat-pmp", + ], +) + +go_test( + name = "nat_test", + srcs = [ + "nat_test.go", + "natupnp_test.go", + ], + embed = [":nat"], + deps = ["@com_github_huin_goupnp//httpu"], +) diff --git a/p2p/netutil/BUILD.bazel b/p2p/netutil/BUILD.bazel new file mode 100644 index 000000000000..7730a347b4e7 --- /dev/null +++ b/p2p/netutil/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "netutil", + srcs = [ + "addrutil.go", + "error.go", + "iptrack.go", + "net.go", + "toobig_notwindows.go", + "toobig_windows.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/netutil", + visibility = ["//visibility:public"], + deps = ["//common/mclock"], +) + +go_test( + name = "netutil_test", + srcs = [ + "error_test.go", + "iptrack_test.go", + "net_test.go", + ], + embed = [":netutil"], + deps = [ + "//common/mclock", + "@com_github_davecgh_go_spew//spew", + ], +) diff --git a/p2p/nodestate/BUILD.bazel b/p2p/nodestate/BUILD.bazel new file mode 100644 index 000000000000..97df024e9f84 --- /dev/null +++ b/p2p/nodestate/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "nodestate", + srcs = ["nodestate.go"], + importpath = "github.com/ava-labs/libevm/p2p/nodestate", + visibility = ["//visibility:public"], + deps = [ + "//common/mclock", + "//ethdb", + "//log", + "//metrics", + "//p2p/enode", + "//p2p/enr", + "//rlp", + ], +) + +go_test( + name = "nodestate_test", + srcs = ["nodestate_test.go"], + embed = [":nodestate"], + deps = [ + "//common/mclock", + "//core/rawdb", + "//p2p/enode", + "//p2p/enr", + "//rlp", + ], +) diff --git a/p2p/rlpx/BUILD.bazel b/p2p/rlpx/BUILD.bazel new file mode 100644 index 000000000000..67a135032601 --- /dev/null +++ b/p2p/rlpx/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rlpx", + srcs = [ + "buffer.go", + "rlpx.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/rlpx", + visibility = ["//visibility:public"], + deps = [ + "//crypto", + "//crypto/ecies", + "//rlp", + "@com_github_golang_snappy//:snappy", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "rlpx_test", + srcs = [ + "buffer_test.go", + "rlpx_test.go", + ], + embed = [":rlpx"], + deps = [ + "//common/hexutil", + "//crypto", + "//crypto/ecies", + "//p2p/simulations/pipes", + "//rlp", + "@com_github_davecgh_go_spew//spew", + "@com_github_stretchr_testify//assert", + ], +) diff --git a/p2p/simulations/BUILD.bazel b/p2p/simulations/BUILD.bazel new file mode 100644 index 000000000000..992f7acad73c --- /dev/null +++ b/p2p/simulations/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "simulations", + srcs = [ + "connect.go", + "events.go", + "http.go", + "mocker.go", + "network.go", + "simulation.go", + "test.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/simulations", + visibility = ["//visibility:public"], + deps = [ + "//event", + "//log", + "//p2p", + "//p2p/enode", + "//p2p/enr", + "//p2p/simulations/adapters", + "//rpc", + "@com_github_gorilla_websocket//:websocket", + "@com_github_julienschmidt_httprouter//:httprouter", + ], +) + +go_test( + name = "simulations_test", + srcs = [ + "connect_test.go", + "http_test.go", + "mocker_test.go", + "network_test.go", + ], + embed = [":simulations"], + deps = [ + "//event", + "//log", + "//node", + "//p2p", + "//p2p/enode", + "//p2p/simulations/adapters", + "//rpc", + "@com_github_mattn_go_colorable//:go-colorable", + "@org_golang_x_exp//slog", + ], +) diff --git a/p2p/simulations/adapters/BUILD.bazel b/p2p/simulations/adapters/BUILD.bazel new file mode 100644 index 000000000000..6128de6fb7e2 --- /dev/null +++ b/p2p/simulations/adapters/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "adapters", + srcs = [ + "exec.go", + "inproc.go", + "types.go", + ], + importpath = "github.com/ava-labs/libevm/p2p/simulations/adapters", + visibility = ["//visibility:public"], + deps = [ + "//crypto", + "//event", + "//internal/reexec", + "//log", + "//node", + "//p2p", + "//p2p/enode", + "//p2p/enr", + "//p2p/simulations/pipes", + "//rpc", + "@com_github_gorilla_websocket//:websocket", + "@org_golang_x_exp//slog", + ], +) + +go_test( + name = "adapters_test", + srcs = ["inproc_test.go"], + embed = [":adapters"], + deps = ["//p2p/simulations/pipes"], +) diff --git a/p2p/simulations/examples/BUILD.bazel b/p2p/simulations/examples/BUILD.bazel new file mode 100644 index 000000000000..c3d120accfff --- /dev/null +++ b/p2p/simulations/examples/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "examples_lib", + srcs = ["ping-pong.go"], + importpath = "github.com/ava-labs/libevm/p2p/simulations/examples", + visibility = ["//visibility:private"], + deps = [ + "//log", + "//node", + "//p2p", + "//p2p/enode", + "//p2p/simulations", + "//p2p/simulations/adapters", + ], +) + +go_binary( + name = "examples", + embed = [":examples_lib"], + visibility = ["//visibility:public"], +) diff --git a/p2p/simulations/pipes/BUILD.bazel b/p2p/simulations/pipes/BUILD.bazel new file mode 100644 index 000000000000..250ad1d5630c --- /dev/null +++ b/p2p/simulations/pipes/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "pipes", + srcs = ["pipes.go"], + importpath = "github.com/ava-labs/libevm/p2p/simulations/pipes", + visibility = ["//visibility:public"], +) diff --git a/p2p/tracker/BUILD.bazel b/p2p/tracker/BUILD.bazel new file mode 100644 index 000000000000..7af1176c089b --- /dev/null +++ b/p2p/tracker/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "tracker", + srcs = ["tracker.go"], + importpath = "github.com/ava-labs/libevm/p2p/tracker", + visibility = ["//visibility:public"], + deps = [ + "//log", + "//metrics", + ], +) diff --git a/params/BUILD.bazel b/params/BUILD.bazel new file mode 100644 index 000000000000..8085b949dba0 --- /dev/null +++ b/params/BUILD.bazel @@ -0,0 +1,54 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "params", + srcs = [ + "bootnodes.go", + "config.go", + "config.libevm.go", + "dao.go", + "denomination.go", + "hooks.libevm.go", + "json.libevm.go", + "network_params.go", + "protocol_params.go", + "version.go", + "version.libevm.go", + ], + importpath = "github.com/ava-labs/libevm/params", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//libevm", + "//libevm/pseudo", + "//libevm/register", + "//log", + "//params/forks", + ], +) + +go_test( + name = "params_test", + srcs = [ + "config.libevm_test.go", + "config_test.go", + "example.libevm_test.go", + "hooks.libevm_test.go", + "json.libevm_test.go", + "version.libevm_test.go", + ], + embed = [":params"], + deps = [ + "//common", + "//common/math", + "//core/vm", + "//libevm", + "//libevm/ethtest", + "//libevm/hookstest", + "//libevm/pseudo", + "//libevm/register", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@org_golang_x_mod//semver", + ], +) diff --git a/params/forks/BUILD.bazel b/params/forks/BUILD.bazel new file mode 100644 index 000000000000..e0b44989770e --- /dev/null +++ b/params/forks/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "forks", + srcs = ["forks.go"], + importpath = "github.com/ava-labs/libevm/params/forks", + visibility = ["//visibility:public"], +) diff --git a/rlp/BUILD.bazel b/rlp/BUILD.bazel new file mode 100644 index 000000000000..e3e4b187ff0f --- /dev/null +++ b/rlp/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rlp", + srcs = [ + "decode.go", + "doc.go", + "encbuffer.go", + "encode.go", + "fields.libevm.go", + "iterator.go", + "list.libevm.go", + "raw.go", + "safe.go", + "typecache.go", + "unsafe.go", + ], + importpath = "github.com/ava-labs/libevm/rlp", + visibility = ["//visibility:public"], + deps = [ + "//rlp/internal/rlpstruct", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "rlp_test", + srcs = [ + "decode_tail_test.go", + "decode_test.go", + "encbuffer_example_test.go", + "encode_test.go", + "encoder_example_test.go", + "fields.libevm_test.go", + "iterator_test.go", + "list.libevm_test.go", + "raw_test.go", + ], + embed = [":rlp"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "@com_github_holiman_uint256//:uint256", + "@com_github_kr_pretty//:pretty", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/rlp/internal/rlpstruct/BUILD.bazel b/rlp/internal/rlpstruct/BUILD.bazel new file mode 100644 index 000000000000..df3b731f073e --- /dev/null +++ b/rlp/internal/rlpstruct/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "rlpstruct", + srcs = ["rlpstruct.go"], + importpath = "github.com/ava-labs/libevm/rlp/internal/rlpstruct", + visibility = ["//rlp:__subpackages__"], +) diff --git a/rlp/rlpgen/BUILD.bazel b/rlp/rlpgen/BUILD.bazel new file mode 100644 index 000000000000..c14caf8a8dfd --- /dev/null +++ b/rlp/rlpgen/BUILD.bazel @@ -0,0 +1,29 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "rlpgen_lib", + srcs = [ + "gen.go", + "main.go", + "types.go", + ], + importpath = "github.com/ava-labs/libevm/rlp/rlpgen", + visibility = ["//visibility:private"], + deps = [ + "//rlp/internal/rlpstruct", + "@org_golang_x_tools//go/packages", + ], +) + +go_binary( + name = "rlpgen", + embed = [":rlpgen_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "rlpgen_test", + srcs = ["gen_test.go"], + data = glob(["testdata/**"]), + embed = [":rlpgen_lib"], +) diff --git a/rpc/BUILD.bazel b/rpc/BUILD.bazel new file mode 100644 index 000000000000..69e85797ba36 --- /dev/null +++ b/rpc/BUILD.bazel @@ -0,0 +1,70 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rpc", + srcs = [ + "client.go", + "client_opt.go", + "context_headers.go", + "doc.go", + "endpoints.go", + "errors.go", + "handler.go", + "http.go", + "inproc.go", + "ipc.go", + "ipc_js.go", + "ipc_unix.go", + "ipc_windows.go", + "json.go", + "metrics.go", + "server.go", + "service.go", + "stdio.go", + "subscription.go", + "types.go", + "websocket.go", + ], + importpath = "github.com/ava-labs/libevm/rpc", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//log", + "//metrics", + "//p2p/netutil", + "@com_github_deckarep_golang_set_v2//:golang-set", + "@com_github_gorilla_websocket//:websocket", + ] + select({ + "@rules_go//go/platform:windows": [ + "@com_github_microsoft_go_winio//:go-winio", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "rpc_test", + srcs = [ + "client_example_test.go", + "client_opt_test.go", + "client_test.go", + "http_test.go", + "server_test.go", + "subscription_test.go", + "testservice_test.go", + "types_test.go", + "websocket_test.go", + ], + data = glob(["testdata/**"]), + embed = [":rpc"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//core/types", + "//log", + "@com_github_davecgh_go_spew//spew", + "@com_github_gorilla_websocket//:websocket", + ], +) diff --git a/signer/core/BUILD.bazel b/signer/core/BUILD.bazel new file mode 100644 index 000000000000..800b24d55d6f --- /dev/null +++ b/signer/core/BUILD.bazel @@ -0,0 +1,62 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "core", + srcs = [ + "api.go", + "auditlog.go", + "cliui.go", + "gnosis_safe.go", + "signed_data.go", + "stdioui.go", + "uiapi.go", + "validation.go", + ], + importpath = "github.com/ava-labs/libevm/signer/core", + visibility = ["//visibility:public"], + deps = [ + "//accounts", + "//accounts/keystore", + "//accounts/scwallet", + "//accounts/usbwallet", + "//common", + "//common/hexutil", + "//common/math", + "//consensus/clique", + "//console/prompt", + "//core/types", + "//crypto", + "//internal/ethapi", + "//log", + "//rlp", + "//rpc", + "//signer/core/apitypes", + "//signer/storage", + "@org_golang_x_exp//slog", + ], +) + +go_test( + name = "core_test", + srcs = [ + "api_test.go", + "signed_data_test.go", + "validation_test.go", + ], + data = glob(["testdata/**"]), + embed = [":core"], + deps = [ + "//accounts", + "//accounts/keystore", + "//common", + "//common/hexutil", + "//common/math", + "//core/types", + "//crypto", + "//internal/ethapi", + "//rlp", + "//signer/core/apitypes", + "//signer/fourbyte", + "//signer/storage", + ], +) diff --git a/signer/core/apitypes/BUILD.bazel b/signer/core/apitypes/BUILD.bazel new file mode 100644 index 000000000000..96f94cafad42 --- /dev/null +++ b/signer/core/apitypes/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "apitypes", + srcs = ["types.go"], + importpath = "github.com/ava-labs/libevm/signer/core/apitypes", + visibility = ["//visibility:public"], + deps = [ + "//accounts", + "//common", + "//common/hexutil", + "//common/math", + "//core/types", + "//crypto", + ], +) + +go_test( + name = "apitypes_test", + srcs = [ + "signed_data_internal_test.go", + "types_test.go", + ], + embed = [":apitypes"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + ], +) diff --git a/signer/fourbyte/BUILD.bazel b/signer/fourbyte/BUILD.bazel new file mode 100644 index 000000000000..7988575a6269 --- /dev/null +++ b/signer/fourbyte/BUILD.bazel @@ -0,0 +1,34 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fourbyte", + srcs = [ + "abi.go", + "fourbyte.go", + "validation.go", + ], + embedsrcs = ["4byte.json"], + importpath = "github.com/ava-labs/libevm/signer/fourbyte", + visibility = ["//visibility:public"], + deps = [ + "//accounts/abi", + "//common", + "//signer/core/apitypes", + ], +) + +go_test( + name = "fourbyte_test", + srcs = [ + "abi_test.go", + "fourbyte_test.go", + "validation_test.go", + ], + embed = [":fourbyte"], + deps = [ + "//accounts/abi", + "//common", + "//common/hexutil", + "//signer/core/apitypes", + ], +) diff --git a/signer/rules/BUILD.bazel b/signer/rules/BUILD.bazel new file mode 100644 index 000000000000..4c3c69ac6227 --- /dev/null +++ b/signer/rules/BUILD.bazel @@ -0,0 +1,32 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rules", + srcs = ["rules.go"], + importpath = "github.com/ava-labs/libevm/signer/rules", + visibility = ["//visibility:public"], + deps = [ + "//internal/ethapi", + "//internal/jsre/deps", + "//log", + "//signer/core", + "//signer/storage", + "@com_github_dop251_goja//:goja", + ], +) + +go_test( + name = "rules_test", + srcs = ["rules_test.go"], + embed = [":rules"], + deps = [ + "//accounts", + "//common", + "//common/hexutil", + "//core/types", + "//internal/ethapi", + "//signer/core", + "//signer/core/apitypes", + "//signer/storage", + ], +) diff --git a/signer/storage/BUILD.bazel b/signer/storage/BUILD.bazel new file mode 100644 index 000000000000..ddd942ad44e5 --- /dev/null +++ b/signer/storage/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storage", + srcs = [ + "aes_gcm_storage.go", + "storage.go", + ], + importpath = "github.com/ava-labs/libevm/signer/storage", + visibility = ["//visibility:public"], + deps = ["//log"], +) + +go_test( + name = "storage_test", + srcs = ["aes_gcm_storage_test.go"], + embed = [":storage"], + deps = [ + "//common", + "//log", + "@com_github_mattn_go_colorable//:go-colorable", + "@org_golang_x_exp//slog", + ], +) diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel new file mode 100644 index 000000000000..d66998e62121 --- /dev/null +++ b/tests/BUILD.bazel @@ -0,0 +1,70 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tests", + srcs = [ + "block_test_util.go", + "difficulty_test_util.go", + "gen_btheader.go", + "gen_difficultytest.go", + "gen_stenv.go", + "gen_sttransaction.go", + "init.go", + "rlp_test_util.go", + "state_test_util.go", + "transaction_test_util.go", + ], + importpath = "github.com/ava-labs/libevm/tests", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//common/math", + "//consensus/beacon", + "//consensus/ethash", + "//consensus/misc/eip4844", + "//core", + "//core/rawdb", + "//core/state", + "//core/state/snapshot", + "//core/types", + "//core/vm", + "//crypto", + "//ethdb", + "//log", + "//params", + "//rlp", + "//triedb", + "//triedb/hashdb", + "//triedb/pathdb", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "tests_test", + srcs = [ + "block_test.go", + "difficulty_test.go", + "init_test.go", + "rlp_test.go", + "state_test.go", + "transaction_test.go", + ], + data = glob( + ["testdata/**"], + allow_empty = True, + ), + embed = [":tests"], + deps = [ + "//common", + "//core", + "//core/rawdb", + "//core/types", + "//core/vm", + "//eth/tracers/logger", + "//params", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/tests/fuzzers/bls12381/BUILD.bazel b/tests/fuzzers/bls12381/BUILD.bazel new file mode 100644 index 000000000000..66eea055dbb8 --- /dev/null +++ b/tests/fuzzers/bls12381/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bls12381", + srcs = [ + "bls12381_fuzz.go", + "precompile_fuzzer.go", + ], + importpath = "github.com/ava-labs/libevm/tests/fuzzers/bls12381", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/vm", + "//crypto/bls12381", + "@com_github_consensys_gnark_crypto//ecc", + "@com_github_consensys_gnark_crypto//ecc/bls12-381", + "@com_github_consensys_gnark_crypto//ecc/bls12-381/fp", + "@com_github_consensys_gnark_crypto//ecc/bls12-381/fr", + "@com_github_supranational_blst//bindings/go", + ], +) + +go_test( + name = "bls12381_test", + srcs = ["bls12381_test.go"], + data = glob(["testdata/**"]), + embed = [":bls12381"], +) diff --git a/tests/fuzzers/bn256/BUILD.bazel b/tests/fuzzers/bn256/BUILD.bazel new file mode 100644 index 000000000000..d672fb2fc3b9 --- /dev/null +++ b/tests/fuzzers/bn256/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bn256", + srcs = ["bn256_fuzz.go"], + importpath = "github.com/ava-labs/libevm/tests/fuzzers/bn256", + visibility = ["//visibility:public"], + deps = [ + "//crypto/bn256/cloudflare", + "//crypto/bn256/google", + "@com_github_consensys_gnark_crypto//ecc/bn254", + ], +) + +go_test( + name = "bn256_test", + srcs = ["bn256_test.go"], + embed = [":bn256"], +) diff --git a/tests/fuzzers/difficulty/BUILD.bazel b/tests/fuzzers/difficulty/BUILD.bazel new file mode 100644 index 000000000000..eb36f46f58a4 --- /dev/null +++ b/tests/fuzzers/difficulty/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "difficulty", + srcs = ["difficulty-fuzz.go"], + importpath = "github.com/ava-labs/libevm/tests/fuzzers/difficulty", + visibility = ["//visibility:public"], + deps = [ + "//consensus/ethash", + "//core/types", + ], +) + +go_test( + name = "difficulty_test", + srcs = ["difficulty_test.go"], + embed = [":difficulty"], +) diff --git a/tests/fuzzers/rangeproof/BUILD.bazel b/tests/fuzzers/rangeproof/BUILD.bazel new file mode 100644 index 000000000000..a13a0be660ac --- /dev/null +++ b/tests/fuzzers/rangeproof/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rangeproof", + srcs = ["rangeproof-fuzzer.go"], + importpath = "github.com/ava-labs/libevm/tests/fuzzers/rangeproof", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/rawdb", + "//ethdb/memorydb", + "//trie", + "//triedb", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "rangeproof_test", + srcs = ["rangeproof_test.go"], + embed = [":rangeproof"], +) diff --git a/tests/fuzzers/secp256k1/BUILD.bazel b/tests/fuzzers/secp256k1/BUILD.bazel new file mode 100644 index 000000000000..9672d8795727 --- /dev/null +++ b/tests/fuzzers/secp256k1/BUILD.bazel @@ -0,0 +1,10 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "secp256k1_test", + srcs = ["secp_test.go"], + deps = [ + "//crypto/secp256k1", + "@com_github_btcsuite_btcd_btcec_v2//:btcec", + ], +) diff --git a/tests/fuzzers/txfetcher/BUILD.bazel b/tests/fuzzers/txfetcher/BUILD.bazel new file mode 100644 index 000000000000..126bfa165b25 --- /dev/null +++ b/tests/fuzzers/txfetcher/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "txfetcher", + srcs = ["txfetcher_fuzzer.go"], + importpath = "github.com/ava-labs/libevm/tests/fuzzers/txfetcher", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/mclock", + "//core/types", + "//eth/fetcher", + ], +) + +go_test( + name = "txfetcher_test", + srcs = ["txfetcher_test.go"], + embed = [":txfetcher"], +) diff --git a/trie/BUILD.bazel b/trie/BUILD.bazel new file mode 100644 index 000000000000..601a22220d4f --- /dev/null +++ b/trie/BUILD.bazel @@ -0,0 +1,80 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "trie", + srcs = [ + "committer.go", + "encoding.go", + "errors.go", + "hasher.go", + "iterator.go", + "node.go", + "node_enc.go", + "proof.go", + "secure_trie.go", + "stacktrie.go", + "sync.go", + "tracer.go", + "trie.go", + "trie_id.go", + "trie_reader.go", + "verkle.go", + ], + importpath = "github.com/ava-labs/libevm/trie", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/prque", + "//core/rawdb", + "//core/types", + "//crypto", + "//ethdb", + "//log", + "//metrics", + "//rlp", + "//trie/trienode", + "//trie/triestate", + "//trie/utils", + "//triedb/database", + "@com_github_gballet_go_verkle//:go-verkle", + "@com_github_holiman_uint256//:uint256", + "@org_golang_x_crypto//sha3", + ], +) + +go_test( + name = "trie_test", + srcs = [ + "database_test.go", + "encoding_test.go", + "iterator_test.go", + "node_test.go", + "proof_test.go", + "secure_trie_test.go", + "stacktrie_fuzzer_test.go", + "stacktrie_test.go", + "sync_test.go", + "tracer_test.go", + "trie_test.go", + "verkle_test.go", + ], + embed = [":trie"], + deps = [ + "//common", + "//core/rawdb", + "//core/types", + "//crypto", + "//ethdb", + "//ethdb/memorydb", + "//rlp", + "//trie/testutil", + "//trie/trienode", + "//trie/utils", + "//triedb/database", + "@com_github_davecgh_go_spew//spew", + "@com_github_holiman_uint256//:uint256", + "@com_github_stretchr_testify//assert", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) diff --git a/trie/testutil/BUILD.bazel b/trie/testutil/BUILD.bazel new file mode 100644 index 000000000000..bbf984df4721 --- /dev/null +++ b/trie/testutil/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "testutil", + srcs = ["utils.go"], + importpath = "github.com/ava-labs/libevm/trie/testutil", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//crypto", + "//trie/trienode", + ], +) diff --git a/trie/trienode/BUILD.bazel b/trie/trienode/BUILD.bazel new file mode 100644 index 000000000000..fa38e3e48a30 --- /dev/null +++ b/trie/trienode/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "trienode", + srcs = [ + "node.go", + "proof.go", + ], + importpath = "github.com/ava-labs/libevm/trie/trienode", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//crypto", + "//ethdb", + "//rlp", + ], +) diff --git a/trie/triestate/BUILD.bazel b/trie/triestate/BUILD.bazel new file mode 100644 index 000000000000..2abad4ba9b64 --- /dev/null +++ b/trie/triestate/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "triestate", + srcs = ["state.go"], + importpath = "github.com/ava-labs/libevm/trie/triestate", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/types", + "//crypto", + "//rlp", + "//trie/trienode", + "@org_golang_x_crypto//sha3", + ], +) diff --git a/trie/utils/BUILD.bazel b/trie/utils/BUILD.bazel new file mode 100644 index 000000000000..9c005cb811e3 --- /dev/null +++ b/trie/utils/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utils", + srcs = ["verkle.go"], + importpath = "github.com/ava-labs/libevm/trie/utils", + visibility = ["//visibility:public"], + deps = [ + "//common/lru", + "//metrics", + "@com_github_crate_crypto_go_ipa//bandersnatch/fr", + "@com_github_gballet_go_verkle//:go-verkle", + "@com_github_holiman_uint256//:uint256", + ], +) + +go_test( + name = "utils_test", + srcs = ["verkle_test.go"], + embed = [":utils"], + deps = [ + "@com_github_gballet_go_verkle//:go-verkle", + "@com_github_holiman_uint256//:uint256", + ], +) diff --git a/triedb/BUILD.bazel b/triedb/BUILD.bazel new file mode 100644 index 000000000000..4e310e2d6fd2 --- /dev/null +++ b/triedb/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "triedb", + srcs = [ + "database.go", + "database.libevm.go", + "preimages.go", + ], + importpath = "github.com/ava-labs/libevm/triedb", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/rawdb", + "//ethdb", + "//log", + "//trie", + "//trie/trienode", + "//trie/triestate", + "//triedb/database", + "//triedb/hashdb", + "//triedb/pathdb", + ], +) + +go_test( + name = "triedb_test", + srcs = ["database.libevm_test.go"], + embed = [":triedb"], + deps = [ + "//common", + "//ethdb", + "//triedb/database", + "@com_github_stretchr_testify//require", + ], +) diff --git a/triedb/database/BUILD.bazel b/triedb/database/BUILD.bazel new file mode 100644 index 000000000000..2ce29c4a9b4e --- /dev/null +++ b/triedb/database/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "database", + srcs = ["database.go"], + importpath = "github.com/ava-labs/libevm/triedb/database", + visibility = ["//visibility:public"], + deps = ["//common"], +) diff --git a/triedb/hashdb/BUILD.bazel b/triedb/hashdb/BUILD.bazel new file mode 100644 index 000000000000..3a2892a19dc8 --- /dev/null +++ b/triedb/hashdb/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "hashdb", + srcs = ["database.go"], + importpath = "github.com/ava-labs/libevm/triedb/hashdb", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//core/rawdb", + "//core/types", + "//ethdb", + "//log", + "//metrics", + "//rlp", + "//trie/trienode", + "//trie/triestate", + "@com_github_victoriametrics_fastcache//:fastcache", + ], +) diff --git a/triedb/pathdb/BUILD.bazel b/triedb/pathdb/BUILD.bazel new file mode 100644 index 000000000000..dedd8b697427 --- /dev/null +++ b/triedb/pathdb/BUILD.bazel @@ -0,0 +1,58 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pathdb", + srcs = [ + "database.go", + "difflayer.go", + "disklayer.go", + "errors.go", + "history.go", + "journal.go", + "layertree.go", + "metrics.go", + "nodebuffer.go", + "testutils.go", + ], + importpath = "github.com/ava-labs/libevm/triedb/pathdb", + visibility = ["//visibility:public"], + deps = [ + "//common", + "//common/hexutil", + "//core/rawdb", + "//core/types", + "//crypto", + "//ethdb", + "//log", + "//metrics", + "//params", + "//rlp", + "//trie/trienode", + "//trie/triestate", + "@com_github_victoriametrics_fastcache//:fastcache", + "@org_golang_x_crypto//sha3", + "@org_golang_x_exp//slices", + ], +) + +go_test( + name = "pathdb_test", + srcs = [ + "database_test.go", + "difflayer_test.go", + "history_test.go", + ], + embed = [":pathdb"], + deps = [ + "//common", + "//core/rawdb", + "//core/types", + "//crypto", + "//ethdb", + "//rlp", + "//trie/testutil", + "//trie/trienode", + "//trie/triestate", + "@com_github_holiman_uint256//:uint256", + ], +)