github.com/klaytn/klaytn@v1.12.1/build/update-license.go (about) 1 // Modifications Copyright 2019 The klaytn Authors 2 // Copyright 2018 The go-ethereum Authors 3 // This file is part of the go-ethereum library. 4 // 5 // The go-ethereum library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The go-ethereum library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 17 // 18 // This file is derived from build/update-license.go (2018/06/04). 19 // Modified and improved for the klaytn development. 20 21 //go:build none 22 // +build none 23 24 /* 25 This command generates GPL license headers on top of all source files. 26 You can run it once per month, before cutting a release or just 27 whenever you feel like it. 28 29 go run update-license.go 30 31 All authors (people who have contributed code) are listed in the 32 AUTHORS file. The author names are mapped and deduplicated using the 33 .mailmap file. You can use .mailmap to set the canonical name and 34 address for each author. See git-shortlog(1) for an explanation of the 35 .mailmap format. 36 37 Please review the resulting diff to check whether the correct 38 copyright assignments are performed. 39 */ 40 41 package main 42 43 import ( 44 "bufio" 45 "bytes" 46 "fmt" 47 "log" 48 "os" 49 "os/exec" 50 "path/filepath" 51 "regexp" 52 "runtime" 53 "sort" 54 "strconv" 55 "strings" 56 "sync" 57 "text/template" 58 "time" 59 ) 60 61 var ( 62 // only files with these extensions will be considered 63 extensions = []string{".go", ".js", ".qml"} 64 65 // paths with any of these prefixes will be skipped 66 skipPrefixes = []string{ 67 // boring stuff 68 "vendor/", "tests/testdata/", "build/", 69 // don't relicense vendored sources 70 "cmd/internal/browser", 71 "cmd/homi", 72 "consensus/ethash/xor.go", 73 "crypto/bn256/", 74 "crypto/ecies/", 75 "crypto/secp256k1", 76 //"crypto/secp256k1/curve.go", 77 "crypto/sha3/", 78 "console/jsre/deps", 79 //"log/", 80 "common/bitutil/bitutil", 81 // don't license generated files 82 "contracts/chequebook/contract/code.go", 83 "log/term", 84 "node/cn/tracers", 85 "metrics/exp", 86 "metrics/influxdb", 87 "metrics/librato", 88 } 89 90 skipSuffixes = []string{ 91 "doc.go", 92 } 93 94 externalLicencePrefixes = []string{ 95 "log", "metrics", 96 } 97 98 // paths with this prefix are licensed as GPL. all other files are LGPL. 99 gplPrefixes = []string{"cmd/"} 100 101 // this regexp must match the entire license comment at the 102 // beginning of each file. 103 ethereumLicenseCommentRE = regexp.MustCompile(`//\s*(Copyright .* (The go-ethereum|AMIS Technologies)).*?\n(?://.*?\n)*//.*>\.`) 104 klaytnLicenseCommentRE = regexp.MustCompile(`//\s*(Copyright .* The klaytn).*?\n(?://.*?\n)?// This file is part of the klaytn library.*\n(?://.*?\n)*//.*>\.`) 105 mixedLicenseCommentRE = regexp.MustCompile(`//\s*(.*Copyright .* The klaytn).*?\n//\s*(Copyright .* (The go-ethereum|AMIS Technologies)).*?\n(?://.*?\n)*//.*klaytn development\.`) 106 externalLicenceCommentRE = regexp.MustCompile(`//\s*(Copyright .* The klaytn).*?\n(?://.*?\n)*//.*See LICENSE in the top directory for the original copyright and license\.`) 107 externalGoLicenceCommentRE = regexp.MustCompile(`//\s*(Copyright .* The Go Authors).*?\n(?://.*?\n)*//.*license that can be found in the LICENSE file\.`) 108 109 // this text appears at the start of AUTHORS 110 authorsFileHeader = "# This is the official list of go-ethereum authors for copyright purposes.\n\n" 111 112 // ethereumDir is original path referenced by klaytn 113 ethereumDir = map[string]string{ 114 "metrics/meter.go": "metrics/meter.go", 115 "metrics/log.go": "metrics/log.go", 116 "metrics/runtime_cgo.go": "metrics/runtime_cgo.go", 117 "metrics/counter_test.go": "metrics/counter_test.go", 118 "metrics/histogram_test.go": "metrics/histogram_test.go", 119 "metrics/sample_test.go": "metrics/sample_test.go", 120 "metrics/metrics.go": "metrics/metrics.go", 121 "metrics/gauge.go": "metrics/gauge.go", 122 "metrics/disk.go": "metrics/disk.go", 123 "metrics/writer_test.go": "metrics/writer_test.go", 124 "metrics/gauge_float64.go": "metrics/gauge_float64.go", 125 "metrics/healthcheck.go": "metrics/healthcheck.go", 126 "metrics/runtime.go": "metrics/runtime.go", 127 "metrics/init_test.go": "metrics/init_test.go", 128 "metrics/metrics_test.go": "metrics/metrics_test.go", 129 "metrics/resetting_timer.go": "metrics/resetting_timer.go", 130 "metrics/opentsdb_test.go": "metrics/opentsdb_test.go", 131 "metrics/graphite.go": "metrics/graphite.go", 132 "metrics/graphite_test.go": "metrics/graphite_test.go", 133 "metrics/ewma_test.go": "metrics/ewma_test.go", 134 "metrics/timer.go": "metrics/timer.go", 135 "metrics/registry.go": "metrics/registry.go", 136 "metrics/histogram.go": "metrics/histogram.go", 137 "metrics/timer_test.go": "metrics/timer_test.go", 138 "metrics/runtime_no_gccpufraction.go": "metrics/runtime_no_gccpufraction.go", 139 "metrics/librato/client.go": "metrics/librato/client.go", 140 "metrics/librato/librato.go": "metrics/librato/librato.go", 141 "metrics/influxdb/influxdb.go": "metrics/influxdb/influxdb.go", 142 "metrics/json_test.go": "metrics/json_test.go", 143 "metrics/writer.go": "metrics/writer.go", 144 "metrics/sample.go": "metrics/sample.go", 145 "metrics/ewma.go": "metrics/ewma.go", 146 "metrics/syslog.go": "metrics/syslog.go", 147 "metrics/debug.go": "metrics/debug.go", 148 "metrics/runtime_gccpufraction.go": "metrics/runtime_gccpufraction.go", 149 "metrics/gauge_float64_test.go": "metrics/gauge_float64_test.go", 150 "metrics/registry_test.go": "metrics/registry_test.go", 151 "metrics/disk_nop.go": "metrics/disk_nop.go", 152 "metrics/disk_linux.go": "metrics/disk_linux.go", 153 "metrics/gauge_test.go": "metrics/gauge_test.go", 154 "metrics/runtime_test.go": "metrics/runtime_test.go", 155 "metrics/meter_test.go": "metrics/meter_test.go", 156 "metrics/counter.go": "metrics/counter.go", 157 "metrics/exp/exp.go": "metrics/exp/exp.go", 158 "metrics/json.go": "metrics/json.go", 159 "metrics/resetting_timer_test.go": "metrics/resetting_timer_test.go", 160 "metrics/runtime_no_cgo.go": "metrics/runtime_no_cgo.go", 161 "metrics/opentsdb.go": "metrics/opentsdb.go", 162 "metrics/debug_test.go": "metrics/debug_test.go", 163 "metrics/prometheus/prometheusmetrics.go": "metrics/prometheus/prometheusmetrics.go", 164 "cmd/kbn/main.go": "cmd/bootnode/main.go", 165 "cmd/kbn/node.go": "node/node.go", 166 "cmd/kcn/main.go": "cmd/geth/main.go", 167 "cmd/ken/main.go": "cmd/geth/main.go", 168 "cmd/kpn/main.go": "cmd/geth/main.go", 169 "cmd/kscn/main.go": "cmd/geth/main.go", 170 "cmd/kspn/main.go": "cmd/geth/main.go", 171 "cmd/ksen/main.go": "cmd/geth/main.go", 172 "cmd/klay/main.go": "cmd/geth/main.go", 173 "cmd/utils/cmd.go": "cmd/utils/cmd.go", 174 "cmd/utils/flags.go": "cmd/utils/flags.go", 175 "cmd/utils/app.go": "cmd/utils/flags.go", 176 "cmd/utils/customflags.go": "cmd/utils/customflags.go", 177 "cmd/utils/nodecmd/accountcmd.go": "cmd/geth/accountcmd.go", 178 "cmd/utils/nodecmd/accountcmd_test.go": "cmd/geth/accountcmd_test.go", 179 "cmd/utils/nodecmd/chaincmd.go": "cmd/geth/chaincmd.go", 180 "cmd/utils/nodecmd/consolecmd.go": "cmd/geth/consolecmd.go", 181 "cmd/utils/nodecmd/consolecmd_test.go": "cmd/geth/consolecmd_test.go", 182 "cmd/utils/nodecmd/defaultcmd.go": "cmd/geth/main.go", 183 "cmd/utils/nodecmd/dumpconfigcmd.go": "cmd/geth/config.go", 184 "cmd/utils/nodecmd/genesis_test.go": "cmd/geth/genesis_test.go", 185 "cmd/utils/nodecmd/flags_test.go": "cmd/geth/genesis_test.go", 186 "cmd/utils/nodecmd/nodeflags.go": "cmd/geth/main.go", 187 "cmd/utils/nodecmd/run_test.go": "cmd/geth/run_test.go", 188 "cmd/utils/nodecmd/versioncmd.go": "cmd/geth/misccmd.go", 189 "cmd/utils/testcmd.go": "cmd/cmdtest/test_cmd.go", 190 "cmd/utils/usage.go": "cmd/geth/usage.go", 191 "cmd/p2psim/main.go": "cmd/p2psim/main.go", 192 "cmd/abigen/main.go": "cmd/abigen/main.go", 193 "cmd/evm/compiler.go": "cmd/evm/compiler.go", 194 "cmd/evm/runner.go": "cmd/evm/runner.go", 195 "cmd/evm/disasm.go": "cmd/evm/disasm.go", 196 "cmd/evm/staterunner.go": "cmd/evm/staterunner.go", 197 "cmd/evm/internal/compiler/compiler.go": "cmd/evm/internal/compiler/compiler.go", 198 "cmd/evm/main.go": "cmd/evm/main.go", 199 "cmd/evm/json_logger.go": "cmd/evm/json_logger.go", 200 "cmd/grpc-contract/internal/impl/contract.go": "sol2proto/types/grpc/contract.go", 201 "cmd/grpc-contract/internal/impl/mapping.go": "sol2proto/types/grpc/mapping.go", 202 "cmd/grpc-contract/internal/impl/method.go": "sol2proto/types/grpc/types.go", 203 "cmd/grpc-contract/main.go": "sol2proto/types/main.go", 204 "consensus/istanbul/config.go": "quorum/consensus/istanbul/config.go", 205 "consensus/istanbul/backend.go": "quorum/consensus/istanbul/backend.go", 206 "consensus/istanbul/core/handler.go": "quorum/consensus/istanbul/core/handler.go", 207 "consensus/istanbul/core/backlog.go": "quorum/consensus/istanbul/core/backlog.go", 208 "consensus/istanbul/core/types.go": "quorum/consensus/istanbul/core/types.go", 209 "consensus/istanbul/core/preprepare.go": "quorum/consensus/istanbul/core/preprepare.go", 210 "consensus/istanbul/core/core.go": "quorum/consensus/istanbul/core/core.go", 211 "consensus/istanbul/core/request.go": "quorum/consensus/istanbul/core/request.go", 212 "consensus/istanbul/core/commit.go": "quorum/consensus/istanbul/core/commit.go", 213 "consensus/istanbul/core/message_set.go": "quorum/consensus/istanbul/core/message_set.go", 214 "consensus/istanbul/core/events.go": "quorum/consensus/istanbul/core/events.go", 215 "consensus/istanbul/core/final_committed.go": "quorum/consensus/istanbul/core/final_committed.go", 216 "consensus/istanbul/core/roundstate.go": "quorum/consensus/istanbul/core/roundstate.go", 217 "consensus/istanbul/core/prepare.go": "quorum/consensus/istanbul/core/prepare.go", 218 "consensus/istanbul/core/errors.go": "quorum/consensus/istanbul/core/errors.go", 219 "consensus/istanbul/core/roundchange.go": "quorum/consensus/istanbul/core/roundchange.go", 220 "consensus/istanbul/validator/validator.go": "quorum/consensus/istanbul/validator/validator.go", 221 "consensus/istanbul/validator/default_test.go": "quorum/consensus/istanbul/validator/default_test.go", 222 "consensus/istanbul/validator/default.go": "quorum/consensus/istanbul/validator/default.go", 223 "consensus/istanbul/validator/weighted.go": "quorum/consensus/istanbul/validator/default.go", 224 "consensus/istanbul/validator.go": "quorum/consensus/istanbul/validator.go", 225 "consensus/istanbul/types.go": "quorum/consensus/istanbul/types.go", 226 "consensus/istanbul/backend/handler.go": "quorum/consensus/istanbul/backend/handler.go", 227 "consensus/istanbul/backend/backend.go": "quorum/consensus/istanbul/backend/backend.go", 228 "consensus/istanbul/backend/engine.go": "quorum/consensus/istanbul/backend/engine.go", 229 "consensus/istanbul/backend/api.go": "quorum/consensus/istanbul/backend/api.go", 230 "consensus/istanbul/backend/snapshot.go": "quorum/consensus/istanbul/backend/snapshot.go", 231 "consensus/istanbul/events.go": "quorum/consensus/istanbul/events.go", 232 "consensus/istanbul/utils.go": "quorum/consensus/istanbul/utils.go", 233 "consensus/istanbul/errors.go": "quorum/consensus/istanbul/errors.go", 234 "consensus/protocol.go": "quorum/consensus/protocol.go", 235 "consensus/consensus.go": "consensus/consensus.go", 236 "consensus/gxhash/sealer.go": "consensus/ethash/sealer.go", 237 "consensus/gxhash/algorithm.go": "consensus/ethash/algorithm.go", 238 "consensus/gxhash/gxhash_test.go": "consensus/ethash/ethash_test.go", 239 "consensus/gxhash/consensus.go": "consensus/ethash/consensus.go", 240 "consensus/gxhash/algorithm_test.go": "consensus/ethash/algorithm_test.go", 241 "consensus/gxhash/gxhash.go": "consensus/ethash/ethash.go", 242 "consensus/gxhash/consensus_test.go": "consensus/ethash/consensus_test.go", 243 "consensus/clique/api.go": "go-ethereum/consensus/clique/api.go", 244 "consensus/clique/clique.go": "go-ethereum/consensus/clique/clique.go", 245 "consensus/clique/snapshot.go": "go-ethereum/consensus/clique/snapshot.go", 246 "crypto/signature_cgo.go": "crypto/signature_cgo.go", 247 "crypto/sha3/register.go": "crypto/sha3/register.go", 248 "crypto/sha3/xor_unaligned.go": "crypto/sha3/xor_unaligned.go", 249 "crypto/sha3/sha3_test.go": "crypto/sha3/sha3_test.go", 250 "crypto/sha3/xor_generic.go": "crypto/sha3/xor_generic.go", 251 "crypto/sha3/shake.go": "crypto/sha3/shake.go", 252 "crypto/sha3/keccakf_amd64.go": "crypto/sha3/keccakf_amd64.go", 253 "crypto/sha3/xor.go": "crypto/sha3/xor.go", 254 "crypto/sha3/doc.go": "crypto/sha3/doc.go", 255 "crypto/sha3/sha3.go": "crypto/sha3/sha3.go", 256 "crypto/sha3/keccakf.go": "crypto/sha3/keccakf.go", 257 "crypto/sha3/hashes.go": "crypto/sha3/hashes.go", 258 "crypto/ecies/params.go": "crypto/ecies/params.go", 259 "crypto/ecies/ecies_test.go": "crypto/ecies/ecies_test.go", 260 "crypto/ecies/ecies.go": "crypto/ecies/ecies.go", 261 "crypto/secp256k1/curve.go": "crypto/secp256k1/curve.go", 262 "crypto/secp256k1/panic_cb.go": "crypto/secp256k1/panic_cb.go", 263 "crypto/secp256k1/secp256.go": "crypto/secp256k1/secp256.go", 264 "crypto/secp256k1/secp256_test.go": "crypto/secp256k1/secp256_test.go", 265 "crypto/bn256/bn256_fast.go": "crypto/bn256/bn256_fast.go", 266 "crypto/bn256/google/optate.go": "crypto/bn256/google/optate.go", 267 "crypto/bn256/google/example_test.go": "crypto/bn256/google/example_test.go", 268 "crypto/bn256/google/bn256_test.go": "crypto/bn256/google/bn256_test.go", 269 "crypto/bn256/google/twist.go": "crypto/bn256/google/twist.go", 270 "crypto/bn256/google/constants.go": "crypto/bn256/google/constants.go", 271 "crypto/bn256/google/curve.go": "crypto/bn256/google/curve.go", 272 "crypto/bn256/google/gfp2.go": "crypto/bn256/google/gfp2.go", 273 "crypto/bn256/google/gfp6.go": "crypto/bn256/google/gfp6.go", 274 "crypto/bn256/google/bn256.go": "crypto/bn256/google/bn256.go", 275 "crypto/bn256/google/gfp12.go": "crypto/bn256/google/gfp12.go", 276 "crypto/bn256/google/main_test.go": "crypto/bn256/google/main_test.go", 277 "crypto/bn256/cloudflare/optate.go": "crypto/bn256/cloudflare/optate.go", 278 "crypto/bn256/cloudflare/gfp_amd64.s": "crypto/bn256/cloudflare/gfp_amd64.s", 279 "crypto/bn256/cloudflare/gfp_decl.go": "crypto/bn256/cloudflare/gfp_decl.go", 280 "crypto/bn256/cloudflare/example_test.go": "crypto/bn256/cloudflare/example_test.go", 281 "crypto/bn256/cloudflare/gfp_generic.go": "crypto/bn256/cloudflare/gfp_generic.go", 282 "crypto/bn256/cloudflare/bn256_test.go": "crypto/bn256/cloudflare/bn256_test.go", 283 "crypto/bn256/cloudflare/twist.go": "crypto/bn256/cloudflare/twist.go", 284 "crypto/bn256/cloudflare/constants.go": "crypto/bn256/cloudflare/constants.go", 285 "crypto/bn256/cloudflare/lattice.go": "crypto/bn256/cloudflare/lattice.go", 286 "crypto/bn256/cloudflare/gfp_test.go": "crypto/bn256/cloudflare/gfp_test.go", 287 "crypto/bn256/cloudflare/curve.go": "crypto/bn256/cloudflare/curve.go", 288 "crypto/bn256/cloudflare/gfp2.go": "crypto/bn256/cloudflare/gfp2.go", 289 "crypto/bn256/cloudflare/gfp.go": "crypto/bn256/cloudflare/gfp.go", 290 "crypto/bn256/cloudflare/gfp6.go": "crypto/bn256/cloudflare/gfp6.go", 291 "crypto/bn256/cloudflare/lattice_test.go": "crypto/bn256/cloudflare/lattice_test.go", 292 "crypto/bn256/cloudflare/bn256.go": "crypto/bn256/cloudflare/bn256.go", 293 "crypto/bn256/cloudflare/gfp12.go": "crypto/bn256/cloudflare/gfp12.go", 294 "crypto/bn256/cloudflare/main_test.go": "crypto/bn256/cloudflare/main_test.go", 295 "crypto/bn256/bn256_fuzz.go": "crypto/bn256/bn256_fuzz.go", 296 "crypto/bn256/bn256_slow.go": "crypto/bn256/bn256_slow.go", 297 "crypto/signature_test.go": "crypto/signature_test.go", 298 "crypto/crypto.go": "crypto/crypto.go", 299 "crypto/crypto_test.go": "crypto/crypto_test.go", 300 "datasync/fetcher/metrics.go": "eth/fetcher/metrics.go", 301 "datasync/fetcher/fetcher_test.go": "eth/fetcher/fetcher_test.go", 302 "datasync/fetcher/fetcher.go": "eth/fetcher/fetcher.go", 303 "datasync/downloader/downloader.go": "eth/downloader/downloader.go", 304 "datasync/downloader/metrics.go": "eth/downloader/metrics.go", 305 "datasync/downloader/queue.go": "eth/downloader/queue.go", 306 "datasync/downloader/modes.go": "eth/downloader/modes.go", 307 "datasync/downloader/types.go": "eth/downloader/types.go", 308 "datasync/downloader/downloader_test.go": "eth/downloader/downloader_test.go", 309 "datasync/downloader/events.go": "eth/downloader/events.go", 310 "datasync/downloader/testchain_test.go": "eth/downloader/testchain_test.go", 311 "datasync/downloader/api.go": "eth/downloader/api.go", 312 "datasync/downloader/peer.go": "eth/downloader/peer.go", 313 "datasync/downloader/statesync.go": "eth/downloader/statesync.go", 314 "interfaces.go": "interfaces.go", 315 "tests/vm_test_util.go": "tests/vm_test_util.go", 316 "tests/gen_stenv.go": "tests/gen_stenv.go", 317 "tests/gen_tttransaction.go": "tests/gen_tttransaction.go", 318 "tests/gen_btheader.go": "tests/gen_btheader.go", 319 "tests/state_test_util.go": "tests/state_test_util.go", 320 "tests/gen_sttransaction.go": "tests/gen_sttransaction.go", 321 "tests/transaction_test.go": "tests/transaction_test.go", 322 "tests/init_test.go": "tests/init_test.go", 323 "tests/gen_vmexec.go": "tests/gen_vmexec.go", 324 "tests/block_test.go": "tests/block_test.go", 325 "tests/transaction_test_util.go": "tests/transaction_test_util.go", 326 "tests/state_test.go": "tests/state_test.go", 327 "tests/rlp_test.go": "tests/rlp_test.go", 328 "tests/vm_test.go": "tests/vm_test.go", 329 "tests/block_test_util.go": "tests/block_test_util.go", 330 "tests/rlp_test_util.go": "tests/rlp_test_util.go", 331 "tests/init.go": "tests/init.go", 332 "utils/build/env.go": "internal/build/env.go", 333 "utils/build/pgp.go": "internal/build/pgp.go", 334 "utils/build/util.go": "internal/build/util.go", 335 "utils/build/archive.go": "internal/build/archive.go", 336 "storage/database/leveldb_database.go": "ethdb/database.go", 337 "storage/database/interface.go": "ethdb/interface.go", 338 "storage/database/database_test.go": "ethdb/database_test.go", 339 "storage/database/memory_database.go": "ethdb/memory_database.go", 340 "storage/database/schema.go": "core/rawdb/schema.go", 341 "storage/statedb/encoding.go": "trie/encoding.go", 342 "storage/statedb/secure_trie.go": "trie/secure_trie.go", 343 "storage/statedb/derive_sha.go": "core/types/derive_sha.go", 344 "storage/statedb/sync.go": "trie/sync.go", 345 "storage/statedb/sync_test.go": "trie/sync_test.go", 346 "storage/statedb/proof_test.go": "trie/proof_test.go", 347 "storage/statedb/database.go": "trie/database.go", 348 "storage/statedb/iterator_test.go": "trie/iterator_test.go", 349 "storage/statedb/encoding_test.go": "trie/encoding_test.go", 350 "storage/statedb/proof.go": "trie/proof.go", 351 "storage/statedb/iterator.go": "trie/iterator.go", 352 "storage/statedb/node_test.go": "trie/node_test.go", 353 "storage/statedb/secure_trie_test.go": "trie/secure_trie_test.go", 354 "storage/statedb/trie.go": "trie/trie.go", 355 "storage/statedb/trie_test.go": "trie/trie_test.go", 356 "storage/statedb/hasher.go": "trie/hasher.go", 357 "storage/statedb/node.go": "trie/node.go", 358 "storage/statedb/errors.go": "trie/errors.go", 359 "blockchain/genesis_test.go": "core/genesis_test.go", 360 "blockchain/helper_test.go": "core/helper_test.go", 361 "blockchain/error.go": "core/error.go", 362 "blockchain/tx_list_test.go": "core/tx_list_test.go", 363 "blockchain/evm.go": "core/evm.go", 364 "blockchain/state_processor.go": "core/state_processor.go", 365 "blockchain/types/log.go": "core/types/log.go", 366 "blockchain/types/transaction_signing.go": "core/types/transaction_signing.go", 367 "blockchain/types/gen_header_json.go": "core/types/gen_header_json.go", 368 "blockchain/types/derive_sha.go": "core/types/derive_sha.go", 369 "blockchain/types/transaction_test.go": "core/types/transaction_test.go", 370 "blockchain/types/log_test.go": "core/types/log_test.go", 371 "blockchain/types/block_test.go": "core/types/block_test.go", 372 "blockchain/types/gen_log_json.go": "core/types/gen_log_json.go", 373 "blockchain/types/transaction.go": "core/types/transaction.go", 374 "blockchain/types/receipt.go": "core/types/receipt.go", 375 "blockchain/types/bloom_test.go": "core/types/bloom9_test.go", 376 "blockchain/types/gen_tx_json.go": "core/types/gen_tx_json.go", 377 "blockchain/types/transaction_signing_test.go": "core/types/transaction_signing_test.go", 378 "blockchain/types/bloom.go": "core/types/bloom9.go", 379 "blockchain/types/gen_receipt_json.go": "core/types/gen_receipt_json.go", 380 "blockchain/types/block.go": "core/types/block.go", 381 "blockchain/types/contract_ref.go": "core/state_transition.go", 382 "blockchain/asm/compiler.go": "core/asm/compiler.go", 383 "blockchain/asm/lex_test.go": "core/asm/lex_test.go", 384 "blockchain/asm/lexer.go": "core/asm/lexer.go", 385 "blockchain/asm/asm_test.go": "core/asm/asm_test.go", 386 "blockchain/asm/asm.go": "core/asm/asm.go", 387 "blockchain/asm/doc.go": "core/asm/asm.go", 388 "blockchain/state_transition.go": "core/state_transition.go", 389 "blockchain/chain_makers.go": "core/chain_makers.go", 390 "blockchain/tx_pool_test.go": "core/tx_pool_test.go", 391 "blockchain/metrics.go": "eth/metrics.go", 392 "blockchain/block_validator_test.go": "core/block_validator_test.go", 393 "blockchain/tx_journal.go": "core/tx_journal.go", 394 "blockchain/genesis_alloc.go": "core/genesis_alloc.go", 395 "blockchain/chain_indexer_test.go": "core/chain_indexer_test.go", 396 "blockchain/types.go": "core/types.go", 397 "blockchain/bad_blocks.go": "core/blocks.go", 398 "blockchain/tx_list.go": "core/tx_list.go", 399 "blockchain/gen_genesis_account.go": "core/gen_genesis_account.go", 400 "blockchain/events.go": "core/events.go", 401 "blockchain/gaspool.go": "core/gaspool.go", 402 "blockchain/state/managed_state_test.go": "core/state/managed_state_test.go", 403 "blockchain/state/journal.go": "core/state/journal.go", 404 "blockchain/state/statedb_test.go": "core/state/statedb_test.go", 405 "blockchain/state/sync.go": "core/state/sync.go", 406 "blockchain/state/managed_state.go": "core/state/managed_state.go", 407 "blockchain/state/database.go": "core/state/database.go", 408 "blockchain/state/state_object.go": "core/state/state_object.go", 409 "blockchain/state/state_test.go": "core/state/state_test.go", 410 "blockchain/state/dump.go": "core/state/dump.go", 411 "blockchain/state/main_test.go": "core/state/main_test.go", 412 "blockchain/state/statedb.go": "core/state/statedb.go", 413 "blockchain/bloombits/scheduler_test.go": "core/bloombits/scheduler_test.go", 414 "blockchain/bloombits/matcher.go": "core/bloombits/matcher.go", 415 "blockchain/bloombits/generator.go": "core/bloombits/generator.go", 416 "blockchain/bloombits/matcher_test.go": "core/bloombits/matcher_test.go", 417 "blockchain/bloombits/generator_test.go": "core/bloombits/generator_test.go", 418 "blockchain/bloombits/scheduler.go": "core/bloombits/scheduler.go", 419 "blockchain/blockchain.go": "core/blockchain.go", 420 "blockchain/vm/memory.go": "core/vm/memory.go", 421 "blockchain/vm/opcodes.go": "core/vm/opcodes.go", 422 "blockchain/vm/analysis.go": "core/vm/analysis.go", 423 "blockchain/vm/gas_table_test.go": "core/vm/gas_table_test.go", 424 "blockchain/vm/gas_table.go": "core/vm/gas_table.go", 425 "blockchain/vm/evm.go": "core/vm/evm.go", 426 "blockchain/vm/gas.go": "core/vm/gas.go", 427 "blockchain/vm/intpool_test.go": "core/vm/intpool_test.go", 428 "blockchain/vm/logger.go": "core/vm/logger.go", 429 "blockchain/vm/int_pool_verifier_empty.go": "core/vm/int_pool_verifier_empty.go", 430 "blockchain/vm/runtime/env.go": "core/vm/runtime/env.go", 431 "blockchain/vm/runtime/runtime.go": "core/vm/runtime/runtime.go", 432 "blockchain/vm/runtime/runtime_example_test.go": "core/vm/runtime/runtime_example_test.go", 433 "blockchain/vm/runtime/doc.go": "core/vm/runtime/doc.go", 434 "blockchain/vm/runtime/runtime_test.go": "core/vm/runtime/runtime_test.go", 435 "blockchain/vm/interface.go": "core/vm/interface.go", 436 "blockchain/vm/analysis_test.go": "core/vm/analysis_test.go", 437 "blockchain/vm/instructions.go": "core/vm/instructions.go", 438 "blockchain/vm/gen_structlog.go": "core/vm/gen_structlog.go", 439 "blockchain/vm/contracts.go": "core/vm/contracts.go", 440 "blockchain/vm/memory_table.go": "core/vm/memory_table.go", 441 "blockchain/vm/instructions_test.go": "core/vm/instructions_test.go", 442 "blockchain/vm/stack.go": "core/vm/stack.go", 443 "blockchain/vm/common.go": "core/vm/common.go", 444 "blockchain/vm/stack_table.go": "core/vm/stack_table.go", 445 "blockchain/vm/interpreter.go": "core/vm/interpreter.go", 446 "blockchain/vm/intpool.go": "core/vm/intpool.go", 447 "blockchain/vm/jump_table.go": "core/vm/jump_table.go", 448 "blockchain/vm/contract.go": "core/vm/contract.go", 449 "blockchain/vm/contracts_test.go": "core/vm/contracts_test.go", 450 "blockchain/vm/logger_test.go": "core/vm/logger_test.go", 451 "blockchain/vm/errors.go": "core/vm/errors.go", 452 "blockchain/vm/logger_json.go": "cmd/evm/json_logger.go", 453 "blockchain/blockchain_test.go": "core/blockchain_test.go", 454 "blockchain/mkalloc.go": "core/mkalloc.go", 455 "blockchain/headerchain.go": "core/headerchain.go", 456 "blockchain/chain_indexer.go": "core/chain_indexer.go", 457 "blockchain/tx_pool.go": "core/tx_pool.go", 458 "blockchain/block_validator.go": "core/block_validator.go", 459 "blockchain/bench_test.go": "core/bench_test.go", 460 "blockchain/genesis.go": "core/genesis.go", 461 "blockchain/chain_makers_test.go": "core/chain_makers_test.go", 462 "blockchain/tx_cacher.go": "core/tx_cacher.go", 463 "blockchain/gen_genesis.go": "core/gen_genesis.go", 464 "networks/p2p/discover/table_test.go": "p2p/discover/table_test.go", 465 "networks/p2p/discover/ntp.go": "p2p/discover/ntp.go", 466 "networks/p2p/discover/database.go": "p2p/discover/database.go", 467 "networks/p2p/discover/udp_test.go": "p2p/discover/udp_test.go", 468 "networks/p2p/discover/database_test.go": "p2p/discover/database_test.go", 469 "networks/p2p/discover/udp.go": "p2p/discover/udp.go", 470 "networks/p2p/discover/node_test.go": "p2p/discover/node_test.go", 471 "networks/p2p/discover/node.go": "p2p/discover/node.go", 472 "networks/p2p/discover/table.go": "p2p/discover/table.go", 473 "networks/p2p/discover/discover_storage_kademlia.go": "p2p/discover/table.go", 474 "networks/p2p/server.go": "p2p/server.go", 475 "networks/p2p/metrics.go": "p2p/metrics.go", 476 "networks/p2p/rlpx_test.go": "p2p/rlpx_test.go", 477 "networks/p2p/dial_test.go": "p2p/dial_test.go", 478 "networks/p2p/rlpx.go": "p2p/rlpx.go", 479 "networks/p2p/nat/natpmp.go": "p2p/nat/natpmp.go", 480 "networks/p2p/nat/natupnp.go": "p2p/nat/natupnp.go", 481 "networks/p2p/nat/nat.go": "p2p/nat/nat.go", 482 "networks/p2p/nat/nat_test.go": "p2p/nat/nat_test.go", 483 "networks/p2p/nat/natupnp_test.go": "p2p/nat/natupnp_test.go", 484 "networks/p2p/message.go": "p2p/message.go", 485 "networks/p2p/protocol.go": "p2p/protocol.go", 486 "networks/p2p/message_test.go": "p2p/message_test.go", 487 "networks/p2p/simulations/mocker_test.go": "p2p/simulations/mocker_test.go", 488 "networks/p2p/simulations/simulation.go": "p2p/simulations/simulation.go", 489 "networks/p2p/simulations/http_test.go": "p2p/simulations/http_test.go", 490 "networks/p2p/simulations/network_test.go": "p2p/simulations/network_test.go", 491 "networks/p2p/simulations/mocker.go": "p2p/simulations/mocker.go", 492 "networks/p2p/simulations/events.go": "p2p/simulations/events.go", 493 "networks/p2p/simulations/pipes/pipes.go": "p2p/simulations/pipes/pipes.go", 494 "networks/p2p/simulations/adapters/docker.go": "p2p/simulations/adapters/docker.go", 495 "networks/p2p/simulations/adapters/types.go": "p2p/simulations/adapters/types.go", 496 "networks/p2p/simulations/adapters/exec.go": "p2p/simulations/adapters/exec.go", 497 "networks/p2p/simulations/adapters/inproc.go": "p2p/simulations/adapters/inproc.go", 498 "networks/p2p/simulations/adapters/ws.go": "p2p/simulations/adapters/ws.go", 499 "networks/p2p/simulations/adapters/ws_test.go": "p2p/simulations/adapters/ws_test.go", 500 "networks/p2p/simulations/adapters/inproc_test.go": "p2p/simulations/adapters/inproc_test.go", 501 "networks/p2p/simulations/network.go": "p2p/simulations/network.go", 502 "networks/p2p/simulations/http.go": "p2p/simulations/http.go", 503 "networks/p2p/simulations/examples/ping-pong.go": "p2p/simulations/examples/ping-pong.go", 504 "networks/p2p/peer_error.go": "p2p/peer_error.go", 505 "networks/p2p/peer.go": "p2p/peer.go", 506 "networks/p2p/netutil/error.go": "p2p/netutil/error.go", 507 "networks/p2p/netutil/net.go": "p2p/netutil/net.go", 508 "networks/p2p/netutil/net_test.go": "p2p/netutil/net_test.go", 509 "networks/p2p/netutil/toobig_notwindows.go": "p2p/netutil/toobig_notwindows.go", 510 "networks/p2p/netutil/error_test.go": "p2p/netutil/error_test.go", 511 "networks/p2p/netutil/toobig_windows.go": "p2p/netutil/toobig_windows.go", 512 "networks/p2p/peer_test.go": "p2p/peer_test.go", 513 "networks/p2p/dial.go": "p2p/dial.go", 514 "networks/p2p/server_test.go": "p2p/server_test.go", 515 "networks/rpc/ipc_unix.go": "rpc/ipc_unix.go", 516 "networks/rpc/ipc_windows.go": "rpc/ipc_windows.go", 517 "networks/rpc/subscription.go": "rpc/subscription.go", 518 "networks/rpc/utils_test.go": "rpc/utils_test.go", 519 "networks/rpc/server.go": "rpc/server.go", 520 "networks/rpc/http_test.go": "rpc/http_test.go", 521 "networks/rpc/types_test.go": "rpc/types_test.go", 522 "networks/rpc/types.go": "rpc/types.go", 523 "networks/rpc/client.go": "rpc/client.go", 524 "networks/rpc/ipc.go": "rpc/ipc.go", 525 "networks/rpc/subscription_test.go": "rpc/subscription_test.go", 526 "networks/rpc/json_test.go": "rpc/json_test.go", 527 "networks/rpc/http.go": "rpc/http.go", 528 "networks/rpc/inproc.go": "rpc/inproc.go", 529 "networks/rpc/utils.go": "rpc/utils.go", 530 "networks/rpc/websocket.go": "rpc/websocket.go", 531 "networks/rpc/client_example_test.go": "rpc/client_example_test.go", 532 "networks/rpc/client_test.go": "rpc/client_test.go", 533 "networks/rpc/endpoints.go": "rpc/endpoints.go", 534 "networks/rpc/json.go": "rpc/json.go", 535 "networks/rpc/server_test.go": "rpc/server_test.go", 536 "networks/rpc/errors.go": "rpc/errors.go", 537 "networks/grpc/gClient.go": "rpc/json.go", 538 "networks/grpc/gServer.go": "rpc/http.go", 539 "common/mclock/mclock.go": "common/mclock/mclock.go", 540 "common/hexutil/hexutil.go": "common/hexutil/hexutil.go", 541 "common/hexutil/hexutil_test.go": "common/hexutil/hexutil_test.go", 542 "common/hexutil/json_example_test.go": "common/hexutil/json_example_test.go", 543 "common/hexutil/json_test.go": "common/hexutil/json_test.go", 544 "common/hexutil/json.go": "common/hexutil/json.go", 545 "common/bitutil/compress_test.go": "common/bitutil/compress_test.go", 546 "common/bitutil/bitutil_test.go": "common/bitutil/bitutil_test.go", 547 "common/bitutil/compress.go": "common/bitutil/compress.go", 548 "common/bitutil/bitutil.go": "common/bitutil/bitutil.go", 549 "common/size_test.go": "common/size_test.go", 550 "common/types_test.go": "common/types_test.go", 551 "common/size.go": "common/size.go", 552 "common/types.go": "common/types.go", 553 "common/format.go": "common/format.go", 554 "common/math/integer_test.go": "common/math/integer_test.go", 555 "common/math/integer.go": "common/math/integer.go", 556 "common/math/big.go": "common/math/big.go", 557 "common/math/big_test.go": "common/math/big_test.go", 558 "common/debug.go": "common/debug.go", 559 "common/utils.go": "common/test_utils.go", 560 "common/fdlimit/fdlimit_test.go": "common/fdlimit/fdlimit_test.go", 561 "common/fdlimit/fdlimit_unix.go": "common/fdlimit/fdlimit_unix.go", 562 "common/fdlimit/fdlimit_windows.go": "common/fdlimit/fdlimit_windows.go", 563 "common/fdlimit/fdlimit_freebsd.go": "common/fdlimit/fdlimit_freebsd.go", 564 "common/path.go": "common/path.go", 565 "common/compiler/solidity.go": "common/compiler/solidity.go", 566 "common/compiler/solidity_test.go": "common/compiler/solidity_test.go", 567 "common/bytes.go": "common/bytes.go", 568 "common/bytes_test.go": "common/bytes_test.go", 569 "common/big.go": "common/big.go", 570 "common/main_test.go": "common/main_test.go", 571 "accounts/accounts.go": "accounts/accounts.go", 572 "accounts/hd.go": "accounts/hd.go", 573 "accounts/keystore/watch_fallback.go": "accounts/keystore/watch_fallback.go", 574 "accounts/keystore/account_cache_test.go": "accounts/keystore/account_cache_test.go", 575 "accounts/keystore/presale.go": "accounts/keystore/presale.go", 576 "accounts/keystore/keystore_passphrase_test.go": "accounts/keystore/keystore_passphrase_test.go", 577 "accounts/keystore/key.go": "accounts/keystore/key.go", 578 "accounts/keystore/file_cache.go": "accounts/keystore/file_cache.go", 579 "accounts/keystore/keystore_test.go": "accounts/keystore/keystore_test.go", 580 "accounts/keystore/keystore_passphrase.go": "accounts/keystore/keystore_passphrase.go", 581 "accounts/keystore/account_cache.go": "accounts/keystore/account_cache.go", 582 "accounts/keystore/keystore_plain_test.go": "accounts/keystore/keystore_plain_test.go", 583 "accounts/keystore/keystore_plain.go": "accounts/keystore/keystore_plain.go", 584 "accounts/keystore/keystore_wallet.go": "accounts/keystore/keystore_wallet.go", 585 "accounts/keystore/keystore.go": "accounts/keystore/keystore.go", 586 "accounts/keystore/watch.go": "accounts/keystore/watch.go", 587 "accounts/abi/error.go": "accounts/abi/error.go", 588 "accounts/abi/event.go": "accounts/abi/event.go", 589 "accounts/abi/argument.go": "accounts/abi/argument.go", 590 "accounts/abi/pack.go": "accounts/abi/pack.go", 591 "accounts/abi/type.go": "accounts/abi/type.go", 592 "accounts/abi/numbers.go": "accounts/abi/numbers.go", 593 "accounts/abi/unpack_test.go": "accounts/abi/unpack_test.go", 594 "accounts/abi/event_test.go": "accounts/abi/event_test.go", 595 "accounts/abi/abi.go": "accounts/abi/abi.go", 596 "accounts/abi/unpack.go": "accounts/abi/unpack.go", 597 "accounts/abi/method.go": "accounts/abi/method.go", 598 "accounts/abi/abi_test.go": "accounts/abi/abi_test.go", 599 "accounts/abi/type_test.go": "accounts/abi/type_test.go", 600 "accounts/abi/reflect.go": "accounts/abi/reflect.go", 601 "accounts/abi/bind/backend.go": "accounts/abi/bind/backend.go", 602 "accounts/abi/bind/auth.go": "accounts/abi/bind/auth.go", 603 "accounts/abi/bind/util_test.go": "accounts/abi/bind/util_test.go", 604 "accounts/abi/bind/backends/simulated.go": "accounts/abi/bind/backends/simulated.go", 605 "accounts/abi/bind/bind_test.go": "accounts/abi/bind/bind_test.go", 606 "accounts/abi/bind/util.go": "accounts/abi/bind/util.go", 607 "accounts/abi/bind/template.go": "accounts/abi/bind/template.go", 608 "accounts/abi/bind/topics.go": "accounts/abi/bind/topics.go", 609 "accounts/abi/bind/bind.go": "accounts/abi/bind/bind.go", 610 "accounts/abi/bind/base.go": "accounts/abi/bind/base.go", 611 "accounts/abi/numbers_test.go": "accounts/abi/numbers_test.go", 612 "accounts/abi/pack_test.go": "accounts/abi/pack_test.go", 613 "accounts/hd_test.go": "accounts/hd_test.go", 614 "accounts/url.go": "accounts/url.go", 615 "accounts/url_test.go": "accounts/url_test.go", 616 "accounts/manager.go": "accounts/manager.go", 617 "accounts/errors.go": "accounts/errors.go", 618 "work/worker.go": "miner/worker.go", 619 "work/remote_agent.go": "miner/remote_agent.go", 620 "work/unconfirmed.go": "miner/unconfirmed.go", 621 "work/agent.go": "miner/agent.go", 622 "work/unconfirmed_test.go": "miner/unconfirmed_test.go", 623 "work/work.go": "miner/miner.go", 624 "params/config.go": "params/config.go", 625 "params/version.go": "params/version.go", 626 "params/gas_table.go": "params/gas_table.go", 627 "params/denomination.go": "params/denomination.go", 628 "params/network_params.go": "params/network_params.go", 629 "params/protocol_params.go": "params/protocol_params.go", 630 "params/computation_cost_params.go": "params/protocol_params.go", 631 "params/bootnodes.go": "params/bootnodes.go", 632 "api/backend.go": "internal/ethapi/backend.go", 633 "api/addrlock.go": "internal/ethapi/addrlock.go", 634 "api/api_private_account.go": "internal/ethapi/api.go", 635 "api/api_private_debug.go": "internal/ethapi/api.go", 636 "api/api_public_account.go": "internal/ethapi/api.go", 637 "api/api_public_blockchain.go": "internal/ethapi/api.go", 638 "api/api_public_cypress.go": "internal/ethapi/api.go", 639 "api/api_public_debug.go": "internal/ethapi/api.go", 640 "api/api_public_klay.go": "internal/ethapi/api.go", 641 "api/api_public_net.go": "internal/ethapi/api.go", 642 "api/api_public_transaction_pool.go": "internal/ethapi/api.go", 643 "api/api_public_tx_pool.go": "internal/ethapi/api.go", 644 "api/debug/trace.go": "internal/debug/trace.go", 645 "api/debug/flags.go": "internal/debug/flags.go", 646 "api/debug/loudpanic_fallback.go": "internal/debug/loudpanic_fallback.go", 647 "api/debug/loudpanic.go": "internal/debug/loudpanic.go", 648 "api/debug/api.go": "internal/debug/api.go", 649 "api/debug/trace_fallback.go": "internal/debug/trace_fallback.go", 650 "log/handler.go": "log/handler.go", 651 "log/handler_glog.go": "log/handler_glog.go", 652 "log/handler_go13.go": "log/handler_go13.go", 653 "log/handler_go14.go": "log/handler_go14.go", 654 "log/log15_logger.go": "log/logger.go", 655 "log/format.go": "log/format.go", 656 "log/handler_syslog.go": "log/syslog.go", 657 "log/term/terminal_openbsd.go": "log/term/terminal_openbsd.go", 658 "log/term/terminal_freebsd.go": "log/term/terminal_freebsd.go", 659 "log/term/terminal_linux.go": "log/term/terminal_linux.go", 660 "log/term/terminal_appengine.go": "log/term/terminal_appengine.go", 661 "log/term/terminal_netbsd.go": "log/term/terminal_netbsd.go", 662 "log/term/terminal_notwindows.go": "log/term/terminal_notwindows.go", 663 "log/term/terminal_solaris.go": "log/term/terminal_solaris.go", 664 "log/term/terminal_darwin.go": "log/term/terminal_darwin.go", 665 "log/term/terminal_windows.go": "log/term/terminal_windows.go", 666 "ser/rlp/raw.go": "rlp/raw.go", 667 "ser/rlp/decode_test.go": "rlp/decode_test.go", 668 "ser/rlp/encode.go": "rlp/encode.go", 669 "ser/rlp/typecache.go": "rlp/typecache.go", 670 "ser/rlp/raw_test.go": "rlp/raw_test.go", 671 "ser/rlp/encoder_example_test.go": "rlp/encoder_example_test.go", 672 "ser/rlp/decode_tail_test.go": "rlp/decode_tail_test.go", 673 "ser/rlp/decode.go": "rlp/decode.go", 674 "ser/rlp/encode_test.go": "rlp/encode_test.go", 675 "node/config.go": "node/config.go", 676 "node/utils_test.go": "node/utils_test.go", 677 "node/node_example_test.go": "node/node_example_test.go", 678 "node/service.go": "node/service.go", 679 "node/cn/filters/filter.go": "eth/filters/filter.go", 680 "node/cn/filters/api.go": "eth/filters/api.go", 681 "node/cn/filters/filter_system_test.go": "eth/filters/filter_system_test.go", 682 "node/cn/filters/api_test.go": "eth/filters/api_test.go", 683 "node/cn/filters/filter_system.go": "eth/filters/filter_system.go", 684 "node/cn/handler.go": "eth/handler.go", 685 "node/cn/api_backend.go": "eth/api_backend.go", 686 "node/cn/api_sc_backend.go": "eth/api_backend.go", 687 "node/cn/tracers/api.go": "eth/tracers/api.go", 688 "node/cn/config.go": "eth/config.go", 689 "node/cn/backend.go": "eth/backend.go", 690 "node/cn/sc_backend.go": "eth/backend.go", 691 "node/cn/gasprice/gasprice.go": "eth/gasprice/gasprice.go", 692 "node/cn/metrics.go": "eth/metrics.go", 693 "node/cn/sync.go": "eth/sync.go", 694 "node/cn/protocol.go": "eth/protocol.go", 695 "node/cn/gen_config.go": "eth/gen_config.go", 696 "node/cn/bloombits.go": "eth/bloombits.go", 697 "node/cn/api.go": "eth/api.go", 698 "node/cn/api_sc.go": "eth/api.go", 699 "node/cn/peer.go": "eth/peer.go", 700 "node/cn/api_test.go": "eth/api_test.go", 701 "node/sc/bridge_addr_journal.go": "core/tx_journal.go", 702 "node/sc/sorted_map_list.go": "core/tx_list.go", 703 "node/sc/bridge_tx_journal.go": "core/tx_journal.go", 704 "node/sc/bridge_tx_list.go": "core/tx_list.go", 705 "node/sc/bridge_tx_pool.go": "core/tx_pool.go", 706 "node/sc/bridgepeer.go": "eth/peer.go", 707 "node/sc/config.go": "eth/config.go", 708 "node/sc/mainbridge.go": "eth/backend.go", 709 "node/sc/metrics.go": "eth/metrics.go", 710 "node/sc/protocol.go": "eth/protocol.go", 711 "node/sc/subbridge.go": "eth/backend.go", 712 "node/service_test.go": "node/service_test.go", 713 "node/defaults.go": "node/defaults.go", 714 "node/api.go": "node/api.go", 715 "node/node_test.go": "node/node_test.go", 716 "node/config_test.go": "node/config_test.go", 717 "node/node.go": "node/node.go", 718 "node/errors.go": "node/errors.go", 719 "event/subscription.go": "event/subscription.go", 720 "event/example_test.go": "event/example_test.go", 721 "event/event.go": "event/event.go", 722 "event/feed.go": "event/feed.go", 723 "event/event_test.go": "event/event_test.go", 724 "event/example_feed_test.go": "event/example_feed_test.go", 725 "event/subscription_test.go": "event/subscription_test.go", 726 "event/example_scope_test.go": "event/example_scope_test.go", 727 "event/feed_test.go": "event/feed_test.go", 728 "event/example_subscription_test.go": "event/example_subscription_test.go", 729 "event/filter/generic_filter.go": "event/filter/generic_filter.go", 730 "event/filter/filter.go": "event/filter/filter.go", 731 "client/klay_client.go": "ethclient/ethclient.go", 732 "client/klay_client_test.go": "ethclient/ethclient_test.go", 733 "client/signer.go": "ethclient/signer.go", 734 "client/bridge_client.go": "ethclient/ethclient.go", 735 "console/prompter.go": "console/prompter.go", 736 "console/console.go": "console/console.go", 737 "console/bridge.go": "console/bridge.go", 738 "console/console_test.go": "console/console_test.go", 739 "console/web3ext/web3ext.go": "internal/web3ext/web3ext.go", 740 "console/jsre/completion.go": "internal/jsre/completion.go", 741 "console/jsre/completion_test.go": "internal/jsre/completion_test.go", 742 "console/jsre/jsre.go": "internal/jsre/jsre.go", 743 "console/jsre/jsre_test.go": "internal/jsre/jsre_test.go", 744 "console/jsre/pretty.go": "internal/jsre/pretty.go", 745 "console/jsre/deps/deps.go": "internal/jsre/deps/deps.go", 746 "console/jsre/deps/bindata.go": "internal/jsre/deps/bindata.go", 747 } 748 ) 749 750 // this template generates the license comment. 751 // its input is an info structure. 752 var klaytnLicenseT = template.Must(template.New("").Parse(` 753 // Copyright {{.Year}} The klaytn Authors 754 // This file is part of the klaytn library. 755 // 756 // The klaytn library is free software: you can redistribute it and/or modify 757 // it under the terms of the GNU Lesser General Public License as published by 758 // the Free Software Foundation, either version 3 of the License, or 759 // (at your option) any later version. 760 // 761 // The klaytn library is distributed in the hope that it will be useful, 762 // but WITHOUT ANY WARRANTY; without even the implied warranty of 763 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 764 // GNU Lesser General Public License for more details. 765 // 766 // You should have received a copy of the GNU Lesser General Public License 767 // along with the klaytn library. If not, see <http://www.gnu.org/licenses/>.`[1:])) 768 769 // this template generates the license comment. 770 // its input is an info structure. 771 var mixedLicenseT = template.Must(template.New("").Parse(` 772 // Modifications Copyright {{.Year}} The klaytn Authors 773 {{.OtherLicence}} 774 // 775 // This file is derived from {{.File}} (2018/06/04). 776 // Modified and improved for the klaytn development.`[1:])) 777 778 // this template generates the license comment. 779 // its input is an info structure. 780 var externalLicenseT = template.Must(template.New("").Parse(` 781 // Copyright {{.Year}} The klaytn Authors 782 // 783 // This file is derived from {{.File}} (2018/06/04). 784 // See LICENSE in the top directory for the original copyright and license.`[1:])) 785 786 type info struct { 787 file string 788 Year int64 789 LastCommit int64 // unit: YYYY 790 otherLicence string 791 } 792 793 // File get derived ethereum path 794 func (i info) File() string { 795 etherdir, exists := ethereumDir[i.file] 796 if !exists { 797 fmt.Printf("Check ethereum dir : %s \n", i.file) 798 } 799 return etherdir 800 } 801 802 // get original ethereum licence 803 func (i info) OtherLicence() string { 804 return i.otherLicence 805 } 806 807 func main() { 808 var ( 809 files = getFiles() 810 filec = make(chan string) 811 infoc = make(chan *info, 20) 812 wg sync.WaitGroup 813 ) 814 815 // writeAuthors(files) 816 817 go func() { 818 for _, f := range files { 819 filec <- f 820 } 821 close(filec) 822 }() 823 for i := runtime.NumCPU(); i >= 0; i-- { 824 // getting file info is slow and needs to be parallel. 825 // it traverses git history for each file. 826 wg.Add(1) 827 go getInfo(filec, infoc, &wg) 828 } 829 go func() { 830 wg.Wait() 831 close(infoc) 832 }() 833 writeLicenses(infoc) 834 } 835 836 // skipFile returns whether the path updates the license 837 func skipFile(path string) bool { 838 if strings.Contains(path, "/testdata/") { 839 return true 840 } 841 for _, p := range skipPrefixes { 842 if strings.HasPrefix(path, p) { 843 return true 844 } 845 } 846 847 for _, p := range skipSuffixes { 848 if strings.HasSuffix(path, p) { 849 return true 850 } 851 } 852 853 return false 854 } 855 856 // externalLiceceFile returns whether the path has external license 857 func externalLicenceFile(path string) bool { 858 for _, p := range externalLicencePrefixes { 859 if strings.HasPrefix(path, p) { 860 return true 861 } 862 } 863 return false 864 } 865 866 // getFiles returns all klaytn files 867 func getFiles() []string { 868 cmd := exec.Command("git", "ls-tree", "-r", "--name-only", "HEAD") 869 var files []string 870 err := doLines(cmd, func(line string) { 871 if skipFile(line) { 872 return 873 } 874 ext := filepath.Ext(line) 875 for _, wantExt := range extensions { 876 if ext == wantExt { 877 goto keep 878 } 879 } 880 return 881 keep: 882 files = append(files, line) 883 }) 884 if err != nil { 885 log.Fatal("error getting files:", err) 886 } 887 return files 888 } 889 890 var authorRegexp = regexp.MustCompile(`\s*[0-9]+\s*(.*)`) 891 892 // gitAuthors returns git authors from files 893 func gitAuthors(files []string) []string { 894 cmds := []string{"shortlog", "-s", "-n", "-e", "HEAD", "--"} 895 cmds = append(cmds, files...) 896 cmd := exec.Command("git", cmds...) 897 var authors []string 898 err := doLines(cmd, func(line string) { 899 m := authorRegexp.FindStringSubmatch(line) 900 if len(m) > 1 { 901 authors = append(authors, m[1]) 902 } 903 }) 904 if err != nil { 905 log.Fatalln("error getting authors:", err) 906 } 907 return authors 908 } 909 910 // gitAuthors returns git authors from AUTHORS file 911 func readAuthors() []string { 912 content, err := os.ReadFile("AUTHORS") 913 if err != nil && !os.IsNotExist(err) { 914 log.Fatalln("error reading AUTHORS:", err) 915 } 916 var authors []string 917 for _, a := range bytes.Split(content, []byte("\n")) { 918 if len(a) > 0 && a[0] != '#' { 919 authors = append(authors, string(a)) 920 } 921 } 922 // Retranslate existing authors through .mailmap. 923 // This should catch email address changes. 924 authors = mailmapLookup(authors) 925 return authors 926 } 927 928 func mailmapLookup(authors []string) []string { 929 if len(authors) == 0 { 930 return nil 931 } 932 cmds := []string{"check-mailmap", "--"} 933 cmds = append(cmds, authors...) 934 cmd := exec.Command("git", cmds...) 935 var translated []string 936 err := doLines(cmd, func(line string) { 937 translated = append(translated, line) 938 }) 939 if err != nil { 940 log.Fatalln("error translating authors:", err) 941 } 942 return translated 943 } 944 945 func writeAuthors(files []string) { 946 merge := make(map[string]bool) 947 // Add authors that Git reports as contributorxs. 948 // This is the primary source of author information. 949 for _, a := range gitAuthors(files) { 950 merge[a] = true 951 } 952 // Add existing authors from the file. This should ensure that we 953 // never lose authors, even if Git stops listing them. We can also 954 // add authors manually this way. 955 for _, a := range readAuthors() { 956 merge[a] = true 957 } 958 // Write sorted list of authors back to the file. 959 var result []string 960 for a := range merge { 961 result = append(result, a) 962 } 963 sort.Strings(result) 964 content := new(bytes.Buffer) 965 content.WriteString(authorsFileHeader) 966 for _, a := range result { 967 content.WriteString(a) 968 content.WriteString("\n") 969 } 970 fmt.Println("writing AUTHORS") 971 if err := os.WriteFile("AUTHORS", content.Bytes(), 0o644); err != nil { 972 log.Fatalln(err) 973 } 974 } 975 976 func getInfo(files <-chan string, out chan<- *info, wg *sync.WaitGroup) { 977 for file := range files { 978 fmt.Println(file) 979 stat, err := os.Lstat(file) 980 if err != nil { 981 fmt.Printf("ERROR %s: %v\n", file, err) 982 continue 983 } 984 if !stat.Mode().IsRegular() { 985 continue 986 } 987 if isGenerated(file) { 988 continue 989 } 990 info, err := fileInfo(file) 991 if err != nil { 992 fmt.Printf("ERROR %s: %v\n", file, err) 993 continue 994 } 995 if info.LastCommit <= 2018 { 996 continue 997 } 998 out <- info 999 } 1000 wg.Done() 1001 } 1002 1003 // isGenerated returns whether the input file is an automatically generated file. 1004 func isGenerated(file string) bool { 1005 fd, err := os.Open(file) 1006 if err != nil { 1007 return false 1008 } 1009 defer fd.Close() 1010 buf := make([]byte, 2048) 1011 n, _ := fd.Read(buf) 1012 buf = buf[:n] 1013 for _, l := range bytes.Split(buf, []byte("\n")) { 1014 if bytes.HasPrefix(l, []byte("// Code generated")) { 1015 return true 1016 } 1017 } 1018 return false 1019 } 1020 1021 // fileInfo finds the lowest year in which the given file was committed. 1022 func fileInfo(file string) (*info, error) { 1023 info := &info{file: file, Year: int64(time.Now().Year()), LastCommit: 0} 1024 cmd := exec.Command("git", "log", "--follow", "--find-renames=80", "--find-copies=80", "--pretty=format:%ai", "--", file) 1025 err := doLines(cmd, func(line string) { 1026 y, err := strconv.ParseInt(line[:4], 10, 64) 1027 if err != nil { 1028 fmt.Printf("cannot parse year: %q", line[:4]) 1029 } 1030 if y < info.Year { 1031 info.Year = y 1032 } 1033 if y > info.LastCommit { 1034 info.LastCommit = y 1035 } 1036 }) 1037 return info, err 1038 } 1039 1040 // writeLicenses write the licenses in the files path in infos. 1041 func writeLicenses(infos <-chan *info) { 1042 for i := range infos { 1043 writeLicense(i) 1044 } 1045 } 1046 1047 // writeLicense write the license in the file path in info. 1048 func writeLicense(info *info) { 1049 fi, err := os.Stat(info.file) 1050 if os.IsNotExist(err) { 1051 fmt.Println("skipping (does not exist)", info.file) 1052 return 1053 } 1054 if err != nil { 1055 log.Fatalf("error stat'ing %s: %v\n", info.file, err) 1056 } 1057 content, err := os.ReadFile(info.file) 1058 if err != nil { 1059 log.Fatalf("error reading %s: %v\n", info.file, err) 1060 } 1061 // Construct new file content. 1062 buf := new(bytes.Buffer) 1063 1064 if m := mixedLicenseCommentRE.FindIndex(content); m != nil { 1065 if e := ethereumLicenseCommentRE.FindIndex(content); e != nil { 1066 info.otherLicence = string(content[e[0]:e[1]]) 1067 mixedLicenseT.Execute(buf, info) 1068 buf.Write(content[m[1]:]) 1069 } else { 1070 return 1071 } 1072 } else if m := ethereumLicenseCommentRE.FindIndex(content); m != nil { 1073 info.otherLicence = string(content[m[0]:m[1]]) 1074 mixedLicenseT.Execute(buf, info) 1075 buf.Write(content[m[1]:]) 1076 } else if m := klaytnLicenseCommentRE.FindIndex(content); m != nil { 1077 klaytnLicenseT.Execute(buf, info) 1078 buf.Write(content[m[1]:]) 1079 } else if m := externalLicenceCommentRE.FindIndex(content); m != nil { 1080 externalLicenseT.Execute(buf, info) 1081 buf.Write(content[m[1]:]) 1082 } else { 1083 if externalLicenceFile(info.file) { 1084 externalLicenseT.Execute(buf, info) 1085 } else { 1086 klaytnLicenseT.Execute(buf, info) 1087 } 1088 buf.Write([]byte("\n\n")) 1089 buf.Write(content) 1090 } 1091 1092 // Write it to the file. 1093 if bytes.Equal(content, buf.Bytes()) { 1094 fmt.Println("skipping (no changes)", info.file) 1095 return 1096 } 1097 if err := os.WriteFile(info.file, buf.Bytes(), fi.Mode()); err != nil { 1098 log.Fatalf("error writing %s: %v", info.file, err) 1099 } 1100 } 1101 1102 // dolines executes cmd 1103 func doLines(cmd *exec.Cmd, f func(string)) error { 1104 stdout, err := cmd.StdoutPipe() 1105 if err != nil { 1106 return err 1107 } 1108 if err := cmd.Start(); err != nil { 1109 return err 1110 } 1111 s := bufio.NewScanner(stdout) 1112 for s.Scan() { 1113 f(s.Text()) 1114 } 1115 if s.Err() != nil { 1116 return s.Err() 1117 } 1118 if err := cmd.Wait(); err != nil { 1119 return fmt.Errorf("%v (for %s)", err, strings.Join(cmd.Args, " ")) 1120 } 1121 return nil 1122 }